diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 80f3fca..0000000 --- a/.editorconfig +++ /dev/null @@ -1,189 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Ignore generated lock files for GitHub Agentic Workflows: -[*.lock.yml] -charset = unset -end_of_line = unset -indent_style = unset -indent_size = unset -trim_trailing_whitespace = unset -insert_final_newline = unset - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 24b327f..0000000 --- a/.gitattributes +++ /dev/null @@ -1,68 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation - -.github/workflows/*.lock.yml linguist-generated=true merge=ours diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 267c5c7..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2026-08-18T03:23:05.731Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index a1f1421..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/map) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index 0696b91..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/map) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1c89592..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '29 17 * * 1' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 83d50c4..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,821 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" - fi - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send notification to Zulip if job fails: - - name: 'Send notification to Zulip in case of failure' - # Pin action to full length commit SHA - uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2 - if: failure() - with: - api-key: ${{ secrets.ZULIP_API_KEY }} - email: 'github-actions-bot@stdlib.zulipchat.com' - organization-url: 'https://stdlib.zulipchat.com' - to: 'workflows-standalone' - type: 'stream' - topic: ${{ github.event.repository.name }} - content: | - :cross_mark: **${{ github.workflow }}** workflow failed - - **Repository:** [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) - **Run:** [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -214,7 +205,7 @@ console.log( ndarray2array( y.data, y.shape, y.strides, y.offset, y.order ) ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.10d_blocked_columnmajor.js b/benchmark/benchmark.10d_blocked_columnmajor.js deleted file mode 100644 index 9881c84..0000000 --- a/benchmark/benchmark.10d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/10d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_blocked_rowmajor.js b/benchmark/benchmark.10d_blocked_rowmajor.js deleted file mode 100644 index 4e8d533..0000000 --- a/benchmark/benchmark.10d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/10d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_columnmajor.js b/benchmark/benchmark.10d_columnmajor.js deleted file mode 100644 index 0c152bc..0000000 --- a/benchmark/benchmark.10d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/10d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_rowmajor.js b/benchmark/benchmark.10d_rowmajor.js deleted file mode 100644 index 827255e..0000000 --- a/benchmark/benchmark.10d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/10d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.11d_columnmajor.js b/benchmark/benchmark.11d_columnmajor.js deleted file mode 100644 index 63c1f0b..0000000 --- a/benchmark/benchmark.11d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/nd.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/11.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 10 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.11d_rowmajor.js b/benchmark/benchmark.11d_rowmajor.js deleted file mode 100644 index 1102f4e..0000000 --- a/benchmark/benchmark.11d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/nd.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/11.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 10 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.1d_columnmajor.js b/benchmark/benchmark.1d_columnmajor.js deleted file mode 100644 index 6d182a2..0000000 --- a/benchmark/benchmark.1d_columnmajor.js +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( [ x, y ], identity ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.1d_rowmajor.js b/benchmark/benchmark.1d_rowmajor.js deleted file mode 100644 index 978d46c..0000000 --- a/benchmark/benchmark.1d_rowmajor.js +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( [ x, y ], identity ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_blocked_columnmajor.js b/benchmark/benchmark.2d_blocked_columnmajor.js deleted file mode 100644 index 6a17985..0000000 --- a/benchmark/benchmark.2d_blocked_columnmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/2d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_blocked_rowmajor.js b/benchmark/benchmark.2d_blocked_rowmajor.js deleted file mode 100644 index e848dc3..0000000 --- a/benchmark/benchmark.2d_blocked_rowmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/2d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_columnmajor.js b/benchmark/benchmark.2d_columnmajor.js deleted file mode 100644 index c7df551..0000000 --- a/benchmark/benchmark.2d_columnmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/2d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor.js b/benchmark/benchmark.2d_rowmajor.js deleted file mode 100644 index 88a9b6d..0000000 --- a/benchmark/benchmark.2d_rowmajor.js +++ /dev/null @@ -1,152 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/2d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor_accessors.js b/benchmark/benchmark.2d_rowmajor_accessors.js deleted file mode 100644 index 1d66ab0..0000000 --- a/benchmark/benchmark.2d_rowmajor_accessors.js +++ /dev/null @@ -1,179 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/2d_accessors.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Returns an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @returns {*} element -*/ -function get( buf, idx ) { - return buf[ idx ]; -} - -/** -* Sets an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @param {*} value - value to set -*/ -function set( buf, idx, value ) { - buf[ idx ] = value; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor_accessors_complex.js b/benchmark/benchmark.2d_rowmajor_accessors_complex.js deleted file mode 100644 index 2e77fbe..0000000 --- a/benchmark/benchmark.2d_rowmajor_accessors_complex.js +++ /dev/null @@ -1,186 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var ctors = require( '@stdlib/array-typed-complex-ctors' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/2d_accessors.js' ); - - -// VARIABLES // - -var types = [ 'complex64' ]; -var order = 'row-major'; -var abtype = { - 'complex64': 'float32', - 'complex128': 'float64' -}; - - -// FUNCTIONS // - -/** -* Returns an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @returns {*} element -*/ -function get( buf, idx ) { - return buf.get( idx ); -} - -/** -* Sets an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @param {*} value - value to set -*/ -function set( buf, idx, value ) { - buf.set( value, idx ); -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var xbuf; - var ybuf; - var x; - var y; - - xbuf = discreteUniform( len*2, -100, 100, { - 'dtype': abtype[ xtype ] - }); - ybuf = zeros( len*2, abtype[ ytype ] ); - x = { - 'dtype': xtype, - 'data': new ( ctors( xtype ) )( xbuf.buffer ), - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - y = { - 'dtype': ytype, - 'data': new ( ctors( ytype ) )( ybuf.buffer ), - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( ybuf[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( ybuf[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 5; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_blocked_columnmajor.js b/benchmark/benchmark.3d_blocked_columnmajor.js deleted file mode 100644 index 5632b90..0000000 --- a/benchmark/benchmark.3d_blocked_columnmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/3d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_blocked_rowmajor.js b/benchmark/benchmark.3d_blocked_rowmajor.js deleted file mode 100644 index 88eb394..0000000 --- a/benchmark/benchmark.3d_blocked_rowmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/3d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_columnmajor.js b/benchmark/benchmark.3d_columnmajor.js deleted file mode 100644 index eeb7f0a..0000000 --- a/benchmark/benchmark.3d_columnmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/3d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_rowmajor.js b/benchmark/benchmark.3d_rowmajor.js deleted file mode 100644 index a15f705..0000000 --- a/benchmark/benchmark.3d_rowmajor.js +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/3d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_blocked_columnmajor.js b/benchmark/benchmark.4d_blocked_columnmajor.js deleted file mode 100644 index c981bfb..0000000 --- a/benchmark/benchmark.4d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/4d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_blocked_rowmajor.js b/benchmark/benchmark.4d_blocked_rowmajor.js deleted file mode 100644 index ce8ab98..0000000 --- a/benchmark/benchmark.4d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/4d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_columnmajor.js b/benchmark/benchmark.4d_columnmajor.js deleted file mode 100644 index 37df74a..0000000 --- a/benchmark/benchmark.4d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/4d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_rowmajor.js b/benchmark/benchmark.4d_rowmajor.js deleted file mode 100644 index 937eb42..0000000 --- a/benchmark/benchmark.4d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/4d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_blocked_columnmajor.js b/benchmark/benchmark.5d_blocked_columnmajor.js deleted file mode 100644 index b46ae0b..0000000 --- a/benchmark/benchmark.5d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/5d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_blocked_rowmajor.js b/benchmark/benchmark.5d_blocked_rowmajor.js deleted file mode 100644 index 78edfa6..0000000 --- a/benchmark/benchmark.5d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/5d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_columnmajor.js b/benchmark/benchmark.5d_columnmajor.js deleted file mode 100644 index 05ddbd3..0000000 --- a/benchmark/benchmark.5d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/5d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_rowmajor.js b/benchmark/benchmark.5d_rowmajor.js deleted file mode 100644 index 6f09dae..0000000 --- a/benchmark/benchmark.5d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/5d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_blocked_columnmajor.js b/benchmark/benchmark.6d_blocked_columnmajor.js deleted file mode 100644 index 8ff762e..0000000 --- a/benchmark/benchmark.6d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/6d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_blocked_rowmajor.js b/benchmark/benchmark.6d_blocked_rowmajor.js deleted file mode 100644 index 5ae209c..0000000 --- a/benchmark/benchmark.6d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/6d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_columnmajor.js b/benchmark/benchmark.6d_columnmajor.js deleted file mode 100644 index f9c7a9e..0000000 --- a/benchmark/benchmark.6d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/6d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_rowmajor.js b/benchmark/benchmark.6d_rowmajor.js deleted file mode 100644 index 2a7478c..0000000 --- a/benchmark/benchmark.6d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/6d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_blocked_columnmajor.js b/benchmark/benchmark.7d_blocked_columnmajor.js deleted file mode 100644 index 1058081..0000000 --- a/benchmark/benchmark.7d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/7d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_blocked_rowmajor.js b/benchmark/benchmark.7d_blocked_rowmajor.js deleted file mode 100644 index e3fb216..0000000 --- a/benchmark/benchmark.7d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/7d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_columnmajor.js b/benchmark/benchmark.7d_columnmajor.js deleted file mode 100644 index 1d1d015..0000000 --- a/benchmark/benchmark.7d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/7d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_rowmajor.js b/benchmark/benchmark.7d_rowmajor.js deleted file mode 100644 index 844bfb4..0000000 --- a/benchmark/benchmark.7d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/7d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_blocked_columnmajor.js b/benchmark/benchmark.8d_blocked_columnmajor.js deleted file mode 100644 index d75c701..0000000 --- a/benchmark/benchmark.8d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/8d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_blocked_rowmajor.js b/benchmark/benchmark.8d_blocked_rowmajor.js deleted file mode 100644 index 450ad22..0000000 --- a/benchmark/benchmark.8d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/8d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_columnmajor.js b/benchmark/benchmark.8d_columnmajor.js deleted file mode 100644 index 87234a4..0000000 --- a/benchmark/benchmark.8d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/8d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_rowmajor.js b/benchmark/benchmark.8d_rowmajor.js deleted file mode 100644 index b5541d6..0000000 --- a/benchmark/benchmark.8d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/8d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_blocked_columnmajor.js b/benchmark/benchmark.9d_blocked_columnmajor.js deleted file mode 100644 index 4bc9690..0000000 --- a/benchmark/benchmark.9d_blocked_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/9d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_blocked_rowmajor.js b/benchmark/benchmark.9d_blocked_rowmajor.js deleted file mode 100644 index 43982c4..0000000 --- a/benchmark/benchmark.9d_blocked_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/9d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_columnmajor.js b/benchmark/benchmark.9d_columnmajor.js deleted file mode 100644 index 42c835f..0000000 --- a/benchmark/benchmark.9d_columnmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/9d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, false, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_rowmajor.js b/benchmark/benchmark.9d_rowmajor.js deleted file mode 100644 index cd51ff4..0000000 --- a/benchmark/benchmark.9d_rowmajor.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isnan = require( '@stdlib/math-base-assert-is-nan' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var identity = require( '@stdlib/number-float64-base-identity' ); -var zeros = require( '@stdlib/array-zeros' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var map = require( './../lib/9d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - input ndarray data type -* @param {string} ytype - output ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype, ytype ) { - var x; - var y; - - x = discreteUniform( len, -100, 100, { - 'dtype': xtype - }); - y = zeros( len, ytype ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - y = { - 'dtype': ytype, - 'data': y, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - map( x, y, true, identity, {} ); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( y.data[ i%len ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var t2; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - t2 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1, t2 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,yorder=%s,xtype=%s,ytype=%s', pkg, sh.length, len, sh.join(','), order, order, t1, t2 ), f ); - } - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 458a893..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/map" -%% click B href "https://github.com/stdlib-js/ndarray-base-map/tree/main" -%% click C href "https://github.com/stdlib-js/ndarray-base-map/tree/production" -%% click D href "https://github.com/stdlib-js/ndarray-base-map/tree/esm" -%% click E href "https://github.com/stdlib-js/ndarray-base-map/tree/deno" -%% click F href "https://github.com/stdlib-js/ndarray-base-map/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/map -[production-url]: https://github.com/stdlib-js/ndarray-base-map/tree/production -[deno-url]: https://github.com/stdlib-js/ndarray-base-map/tree/deno -[deno-readme]: https://github.com/stdlib-js/ndarray-base-map/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/ndarray-base-map/tree/umd -[umd-readme]: https://github.com/stdlib-js/ndarray-base-map/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/ndarray-base-map/tree/esm -[esm-readme]: https://github.com/stdlib-js/ndarray-base-map/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 4504e2e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import map from '../docs/types/index'; -export = map; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b2a2e83..0000000 --- a/dist/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";var lr=function(a,v){return function(){try{return v||a((v={exports:{}}).exports,v),v.exports}catch(Y){throw v=0,Y}}};var Rr=lr(function(O0,Lr){"use strict";var jv=require("@stdlib/ndarray-base-unary-loop-interchange-order"),mv=require("@stdlib/ndarray-base-unary-tiling-block-size"),kv=require("@stdlib/array-base-take-indexed"),zv=require("@stdlib/array-base-reverse");function gv(a,v,Y,U){var r,A,F,R,L,B,P,T,D,C,K,_,w,E,h,O,q,k,x,z,i,S,d,f,e,l;for(l=jv(a.shape,a.strides,v.strides),w=l.sh,O=l.sx,q=l.sy,C=zv(l.idx),r=mv(a.dtype,v.dtype),k=a.offset,x=v.offset,A=a.data,F=v.data,R=O[0],B=q[0],e=w[1];e>0;)for(e0;)for(f0;)for(b0;)for(c0;)for(o0;)for(m0;)for(M0;)for(n0;)for(t0;)for(N0;)for(G0;)for(H0;)for(Q0;)for(J0;)for(dr0;)for(ar0;)for($0;)for(Z0;)for(V0;)for(sr0;)for(fr0;)for(tr0;)for(ir0;)for(or0;)for(er0;)for(vr0;)for(rr0;)for(qr0;)for(ur0;)for(cr0;)for(xr0;)for(pr0;)for(Sr0;)for(yr0;)for(fr0;)for(zr0;)for(hr0;)for(br0;)for(mr0;)for(jr0;)for(kr0;)for(nr0;)for(qr0;)for(ur0;)for(wr0;)for(Mr0;)for(Er0;)for(Pr0;)for(Tr0;)for(Or0;)for(gr0;)for(zr0;)for(hr0;)for(br0;)for(d0;)for(S0;)for(o0;)for(u0;)for(j0;)for(n0;)for(t0;)for(p0;)for(g0;)for(H0;)for(Q0;)for(J0;)for(I0;)for(X0;)for($0;)for(Z0;)for(V0;)for(sr0;)for(W0;)for(N0;)for(ir0;)for(or0;)for(er0;)for(vr0;)for(rr0;)for(dr0;)for(ar0;)for(cr0;)for(xr0;)for(pr0;)for(Sr0;)for(yr0;)for(fr0;)for(tr0;)for(ir0;)for(br0;)for(mr0;)for(jr0;)for(kr0;)for(nr0;)for(qr0;)for(ur0;)for(cr0;)for(xr0;)for(Er0;)for(Pr0;)for(Tr0;)for(Or0;)for(gr0;)for(zr0;)for(hr0;)for(br0;)for(mr0;)for(jr} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap2d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap2d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar ox1;\n\tvar oy1;\n\tvar idx;\n\tvar get;\n\tvar set;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\toy1 = oy + ( j1*sy[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offsets for the first input and output ndarray elements in the current block...\n\t\t\tix = ox1 + (j0*sx[0]);\n\t\t\tiy = oy1 + (j0*sy[0]);\n\n\t\t\t// Compute the loop offset increments...\n\t\t\tdx1 = sx[1] - (s0*sx[0]);\n\t\t\tdy1 = sy[1] - (s0*sy[0]);\n\n\t\t\t// Cache accessors:\n\t\t\tget = x.accessors[0];\n\t\t\tset = y.accessors[1];\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 2, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap3d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap3d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar ox1;\n\tvar ox2;\n\tvar oy1;\n\tvar oy2;\n\tvar idx;\n\tvar get;\n\tvar set;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\toy2 = oy + ( j2*sy[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tdy2 = sy[2] - ( s1*sy[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t// Compute loop offset increments...\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\t\t\t\tdy1 = sy[1] - ( s0*sy[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap4d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\tS3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\tS3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\toy3 = oy + ( j3*sy[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\tS2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\tS2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\tS1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t// Cache accessors:\n\t\t\t\t\tget = x.accessors[ 0 ];\n\t\t\t\t\tset = y.accessors[ 1 ];\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap5d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\tS4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\tS4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\toy4 = oy + ( j4*sy[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\tS3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\tS3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\tS2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap6d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\tS5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\tS5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\toy5 = oy + ( j5*sy[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\tS4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\tS4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\tS3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap7d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\tS6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\tS6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\toy6 = oy + ( j6*sy[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\tS5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\tS5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\tS4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap8d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\tS7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\tS7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\toy7 = oy + ( j7*sy[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\tS6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\tS6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\tS5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap9d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\tS8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\tS8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\toy8 = oy + ( j8*sy[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\tS7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\tS7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\tS6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti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odule.exports = blockedmap9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap10d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar oy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\tS9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\tS9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\toy9 = oy + ( j9*sy[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\tS8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\tS8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( S8*sx[8] );\n\t\t\tdy9 = sy[9] - ( S8*sy[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\toy8 = oy9 + ( j8*sy[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\tS7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\tS6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t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t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap2d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0 ]\n*/\nfunction blockedmap2d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar ox1;\n\tvar oy1;\n\tvar idx;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\toy1 = oy + ( j1*sy[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offsets for the first input and output ndarray elements in the current block...\n\t\t\tix = ox1 + (j0*sx[0]);\n\t\t\tiy = oy1 + (j0*sy[0]);\n\n\t\t\t// Compute the loop offset increments...\n\t\t\tdx1 = sx[1] - (s0*sx[0]);\n\t\t\tdy1 = sy[1] - (s0*sy[0]);\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap3d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap3d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar ox1;\n\tvar ox2;\n\tvar oy1;\n\tvar oy2;\n\tvar idx;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\toy2 = oy + ( j2*sy[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tdy2 = sy[2] - ( s1*sy[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t// Compute loop offset increments...\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\t\t\t\tdy1 = sy[1] - ( s0*sy[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n* var sy = [ 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap4d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\tS3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\tS3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\toy3 = oy + ( j3*sy[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\tS2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\tS2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\tS1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap5d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\tS4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\tS4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\toy4 = oy + ( j4*sy[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\tS3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\tS3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\tS2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap6d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\tS5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\tS5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\toy5 = oy + ( j5*sy[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\tS4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\tS4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\tS3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap7d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\tS6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\tS6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\toy6 = oy + ( j6*sy[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\tS5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\tS5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\tS4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap8d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\tS7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\tS7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\toy7 = oy + ( j7*sy[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\tS6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\tS6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\tS5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap9d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\tS8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\tS8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\toy8 = oy + ( j8*sy[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\tS7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\tS7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\tS6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap10d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar oy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\tS9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\tS9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\toy9 = oy + ( j9*sy[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\tS8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\tS8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( S8*sx[8] );\n\t\t\tdy9 = sy[9] - ( S8*sy[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\toy8 = oy9 + ( j8*sy[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\tS7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\tS6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedmap10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a zero-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );\n* var ybuf = new Complex64Array( 2 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n* var sy = [ 0 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map0d( x, y, scale, {} );\n* // ybuf => [ 30.0, 40.0, 0.0, 0.0 ]\n*/\nfunction map0d( x, y, fcn, thisArg ) {\n\ty.accessors[ 1 ]( y.data, y.offset, fcn.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = map0d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a one-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 1 ];\n* var sy = [ 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map1d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map1d( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dy0;\n\tvar S0;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\tdy0 = y.strides[ 0 ];\n\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), [ i0 ], x.ref ) );\n\t\tix += dx0;\n\t\tiy += dy0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map1d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map2d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map2d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for the outermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 1 ];\n\t\tdy1 = sy[ 0 ] - ( S0*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for outermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sx[0] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointer to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\tix += dx0;\n\t\t\tiy += dy0;\n\t\t}\n\t\tix += dx1;\n\t\tiy += dy1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n* var sy = [ 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map3d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map3d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar idx;\n\tvar get;\n\tvar set;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 2 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[2] );\n\t\tdy2 = sy[ 0 ] - ( S1*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\tix += dx0;\n\t\t\t\tiy += dy0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t\tiy += dy1;\n\t\t}\n\t\tix += dx2;\n\t\tiy += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map4d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map4d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 3 ];\n\t\tdy1 = sy[ 2 ] - ( S0*sy[3] );\n\t\tdy2 = sy[ 1 ] - ( S1*sy[2] );\n\t\tdy3 = sy[ 0 ] - ( S2*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t\tiy += dy2;\n\t\t}\n\t\tix += dx3;\n\t\tiy += dy3;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map5d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map5d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 4 ];\n\t\tdy1 = sy[ 3 ] - ( S0*sy[4] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[3] );\n\t\tdy3 = sy[ 1 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 0 ] - ( S3*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t\tiy += dy1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t\tiy += dy2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t\tiy += dy3;\n\t\t}\n\t\tix += dx4;\n\t\tiy += dy4;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map6d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map6d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 5 ];\n\t\tdy1 = sy[ 4 ] - ( S0*sy[5] );\n\t\tdy2 = sy[ 3 ] - ( S1*sy[4] );\n\t\tdy3 = sy[ 2 ] - ( S2*sy[3] );\n\t\tdy4 = sy[ 1 ] - ( S3*sy[2] );\n\t\tdy5 = sy[ 0 ] - ( S4*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t\tiy += dy3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t\tiy += dy4;\n\t\t}\n\t\tix += dx5;\n\t\tiy += dy5;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map7d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 6 ];\n\t\tdy1 = sy[ 5 ] - ( S0*sy[6] );\n\t\tdy2 = sy[ 4 ] - ( S1*sy[5] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[4] );\n\t\tdy4 = sy[ 2 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 1 ] - ( S4*sy[2] );\n\t\tdy6 = sy[ 0 ] - ( S5*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t\tiy += dy3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t\tiy += dy4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t\tiy += dy5;\n\t\t}\n\t\tix += dx6;\n\t\tiy += dy6;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map8d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 7 ];\n\t\tdy1 = sy[ 6 ] - ( S0*sy[7] );\n\t\tdy2 = sy[ 5 ] - ( S1*sy[6] );\n\t\tdy3 = sy[ 4 ] - ( S2*sy[5] );\n\t\tdy4 = sy[ 3 ] - ( S3*sy[4] );\n\t\tdy5 = sy[ 2 ] - ( S4*sy[3] );\n\t\tdy6 = sy[ 1 ] - ( S5*sy[2] );\n\t\tdy7 = sy[ 0 ] - ( S6*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t\tiy += dy4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t\tiy += dy5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t\tiy += dy6;\n\t\t}\n\t\tix += dx7;\n\t\tiy += dy7;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map9d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 8 ];\n\t\tdy1 = sy[ 7 ] - ( S0*sy[8] );\n\t\tdy2 = sy[ 6 ] - ( S1*sy[7] );\n\t\tdy3 = sy[ 5 ] - ( S2*sy[6] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[5] );\n\t\tdy5 = sy[ 3 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 2 ] - ( S5*sy[3] );\n\t\tdy7 = sy[ 1 ] - ( S6*sy[2] );\n\t\tdy8 = sy[ 0 ] - ( S7*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t\tiy += dy5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t\tiy += dy6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t\tiy += dy7;\n\t\t}\n\t\tix += dx8;\n\t\tiy += dy8;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map10d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 9 ];\n\t\tdy1 = sy[ 8 ] - ( S0*sy[9] );\n\t\tdy2 = sy[ 7 ] - ( S1*sy[8] );\n\t\tdy3 = sy[ 6 ] - ( S2*sy[7] );\n\t\tdy4 = sy[ 5 ] - ( S3*sy[6] );\n\t\tdy5 = sy[ 4 ] - ( S4*sy[5] );\n\t\tdy6 = sy[ 3 ] - ( S5*sy[4] );\n\t\tdy7 = sy[ 2 ] - ( S6*sy[3] );\n\t\tdy8 = sy[ 1 ] - ( S7*sy[2] );\n\t\tdy9 = sy[ 0 ] - ( S8*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tdy9 = sy[ 9 ] - ( S8*sy[8] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t\tiy += dy6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t\tiy += dy7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t\tiy += dy8;\n\t\t}\n\t\tix += dx9;\n\t\tiy += dy9;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar vind2bind = require( '@stdlib/ndarray-base-vind2bind' );\nvar ind2sub = require( '@stdlib/ndarray-base-ind2sub' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an -dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var realf = require( '@stdlib/complex-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* mapnd( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction mapnd( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar get;\n\tvar set;\n\tvar idx;\n\tvar sh;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( sh, sy, oy, ordy, i, MODE );\n\t\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), idx, x.ref ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a zero-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ){\n* return z * 10.0;\n* }\n*\n* // Create a data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n* var ybuf = new Float64Array( 1 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n* var sy = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* }\n*\n* // Apply function:\n* map0d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0 ]\n*/\nfunction map0d( x, y, fcn, thisArg ) {\n\ty.data[ y.offset ] = fcn.call( thisArg, x.data[ x.offset ], [], x.ref );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map0d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a one-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n* var sy = [ 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map1d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 40.0, 60.0, 80.0 ]\n*/\nfunction map1d( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dy0;\n\tvar S0;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\tdy0 = y.strides[ 0 ];\n\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], [ i0 ], x.ref );\n\t\tix += dx0;\n\t\tiy += dy0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map1d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map2d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0 ]\n*/\nfunction map2d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for the outermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 1 ];\n\t\tdy1 = sy[ 0 ] - ( S0*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for outermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sx[0] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointer to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\tix += dx0;\n\t\t\tiy += dy0;\n\t\t}\n\t\tix += dx1;\n\t\tiy += dy1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map3d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map3d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 2 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[2] );\n\t\tdy2 = sy[ 0 ] - ( S1*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\tix += dx0;\n\t\t\t\tiy += dy0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t\tiy += dy1;\n\t\t}\n\t\tix += dx2;\n\t\tiy += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n* var sy = [ 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map4d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map4d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 3 ];\n\t\tdy1 = sy[ 2 ] - ( S0*sy[3] );\n\t\tdy2 = sy[ 1 ] - ( S1*sy[2] );\n\t\tdy3 = sy[ 0 ] - ( S2*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t\tiy += dy2;\n\t\t}\n\t\tix += dx3;\n\t\tiy += dy3;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map5d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map5d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 4 ];\n\t\tdy1 = sy[ 3 ] - ( S0*sy[4] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[3] );\n\t\tdy3 = sy[ 1 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 0 ] - ( S3*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t\tiy += dy1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t\tiy += dy2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t\tiy += dy3;\n\t\t}\n\t\tix += dx4;\n\t\tiy += dy4;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map6d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map6d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 5 ];\n\t\tdy1 = sy[ 4 ] - ( S0*sy[5] );\n\t\tdy2 = sy[ 3 ] - ( S1*sy[4] );\n\t\tdy3 = sy[ 2 ] - ( S2*sy[3] );\n\t\tdy4 = sy[ 1 ] - ( S3*sy[2] );\n\t\tdy5 = sy[ 0 ] - ( S4*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t\tiy += dy3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t\tiy += dy4;\n\t\t}\n\t\tix += dx5;\n\t\tiy += dy5;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map7d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 6 ];\n\t\tdy1 = sy[ 5 ] - ( S0*sy[6] );\n\t\tdy2 = sy[ 4 ] - ( S1*sy[5] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[4] );\n\t\tdy4 = sy[ 2 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 1 ] - ( S4*sy[2] );\n\t\tdy6 = sy[ 0 ] - ( S5*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t\tiy += dy3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t\tiy += dy4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t\tiy += dy5;\n\t\t}\n\t\tix += dx6;\n\t\tiy += dy6;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map8d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 7 ];\n\t\tdy1 = sy[ 6 ] - ( S0*sy[7] );\n\t\tdy2 = sy[ 5 ] - ( S1*sy[6] );\n\t\tdy3 = sy[ 4 ] - ( S2*sy[5] );\n\t\tdy4 = sy[ 3 ] - ( S3*sy[4] );\n\t\tdy5 = sy[ 2 ] - ( S4*sy[3] );\n\t\tdy6 = sy[ 1 ] - ( S5*sy[2] );\n\t\tdy7 = sy[ 0 ] - ( S6*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t\tiy += dy4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t\tiy += dy5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t\tiy += dy6;\n\t\t}\n\t\tix += dx7;\n\t\tiy += dy7;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map9d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 8 ];\n\t\tdy1 = sy[ 7 ] - ( S0*sy[8] );\n\t\tdy2 = sy[ 6 ] - ( S1*sy[7] );\n\t\tdy3 = sy[ 5 ] - ( S2*sy[6] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[5] );\n\t\tdy5 = sy[ 3 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 2 ] - ( S5*sy[3] );\n\t\tdy7 = sy[ 1 ] - ( S6*sy[2] );\n\t\tdy8 = sy[ 0 ] - ( S7*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t\tiy += dy5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t\tiy += dy6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t\tiy += dy7;\n\t\t}\n\t\tix += dx8;\n\t\tiy += dy8;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map10d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 9 ];\n\t\tdy1 = sy[ 8 ] - ( S0*sy[9] );\n\t\tdy2 = sy[ 7 ] - ( S1*sy[8] );\n\t\tdy3 = sy[ 6 ] - ( S2*sy[7] );\n\t\tdy4 = sy[ 5 ] - ( S3*sy[6] );\n\t\tdy5 = sy[ 4 ] - ( S4*sy[5] );\n\t\tdy6 = sy[ 3 ] - ( S5*sy[4] );\n\t\tdy7 = sy[ 2 ] - ( S6*sy[3] );\n\t\tdy8 = sy[ 1 ] - ( S7*sy[2] );\n\t\tdy9 = sy[ 0 ] - ( S8*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tdy9 = sy[ 9 ] - ( S8*sy[8] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t\tiy += dy6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t\tiy += dy7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t\tiy += dy8;\n\t\t}\n\t\tix += dx9;\n\t\tiy += dy9;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar vind2bind = require( '@stdlib/ndarray-base-vind2bind' );\nvar ind2sub = require( '@stdlib/ndarray-base-ind2sub' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an n-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* mapnd( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0 ]\n*/\nfunction mapnd( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar idx;\n\tvar sh;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( sh, sy, oy, ordy, i, MODE );\n\t\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], idx, x.ref );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar iterationOrder = require( '@stdlib/ndarray-base-iteration-order' );\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\nvar ndarray2object = require( '@stdlib/ndarray-base-ndarraylike2object' );\nvar format = require( '@stdlib/string-format' );\nvar blockedaccessormap2d = require( './2d_blocked_accessors.js' );\nvar blockedaccessormap3d = require( './3d_blocked_accessors.js' );\nvar blockedaccessormap4d = require( './4d_blocked_accessors.js' );\nvar blockedaccessormap5d = require( './5d_blocked_accessors.js' );\nvar blockedaccessormap6d = require( './6d_blocked_accessors.js' );\nvar blockedaccessormap7d = require( './7d_blocked_accessors.js' );\nvar blockedaccessormap8d = require( './8d_blocked_accessors.js' );\nvar blockedaccessormap9d = require( './9d_blocked_accessors.js' );\nvar blockedaccessormap10d = require( './10d_blocked_accessors.js' );\nvar blockedmap2d = require( './2d_blocked.js' );\nvar blockedmap3d = require( './3d_blocked.js' );\nvar blockedmap4d = require( './4d_blocked.js' );\nvar blockedmap5d = require( './5d_blocked.js' );\nvar blockedmap6d = require( './6d_blocked.js' );\nvar blockedmap7d = require( './7d_blocked.js' );\nvar blockedmap8d = require( './8d_blocked.js' );\nvar blockedmap9d = require( './9d_blocked.js' );\nvar blockedmap10d = require( './10d_blocked.js' );\nvar accessormap0d = require( './0d_accessors.js' );\nvar accessormap1d = require( './1d_accessors.js' );\nvar accessormap2d = require( './2d_accessors.js' );\nvar accessormap3d = require( './3d_accessors.js' );\nvar accessormap4d = require( './4d_accessors.js' );\nvar accessormap5d = require( './5d_accessors.js' );\nvar accessormap6d = require( './6d_accessors.js' );\nvar accessormap7d = require( './7d_accessors.js' );\nvar accessormap8d = require( './8d_accessors.js' );\nvar accessormap9d = require( './9d_accessors.js' );\nvar accessormap10d = require( './10d_accessors.js' );\nvar accessormapnd = require( './nd_accessors.js' );\nvar map0d = require( './0d.js' );\nvar map1d = require( './1d.js' );\nvar map2d = require( './2d.js' );\nvar map3d = require( './3d.js' );\nvar map4d = require( './4d.js' );\nvar map5d = require( './5d.js' );\nvar map6d = require( './6d.js' );\nvar map7d = require( './7d.js' );\nvar map8d = require( './8d.js' );\nvar map9d = require( './9d.js' );\nvar map10d = require( './10d.js' );\nvar mapnd = require( './nd.js' );\n\n\n// VARIABLES //\n\nvar MAP = [\n\tmap0d,\n\tmap1d,\n\tmap2d,\n\tmap3d,\n\tmap4d,\n\tmap5d,\n\tmap6d,\n\tmap7d,\n\tmap8d,\n\tmap9d,\n\tmap10d\n];\nvar ACCESSOR_MAP = [\n\taccessormap0d,\n\taccessormap1d,\n\taccessormap2d,\n\taccessormap3d,\n\taccessormap4d,\n\taccessormap5d,\n\taccessormap6d,\n\taccessormap7d,\n\taccessormap8d,\n\taccessormap9d,\n\taccessormap10d\n];\nvar BLOCKED_MAP = [\n\tblockedmap2d, // 0\n\tblockedmap3d,\n\tblockedmap4d,\n\tblockedmap5d,\n\tblockedmap6d,\n\tblockedmap7d,\n\tblockedmap8d,\n\tblockedmap9d,\n\tblockedmap10d // 8\n];\nvar BLOCKED_ACCESSOR_MAP = [\n\tblockedaccessormap2d, // 0\n\tblockedaccessormap3d,\n\tblockedaccessormap4d,\n\tblockedaccessormap5d,\n\tblockedaccessormap6d,\n\tblockedaccessormap7d,\n\tblockedaccessormap8d,\n\tblockedaccessormap9d,\n\tblockedaccessormap10d // 8\n];\nvar MAX_DIMS = MAP.length -1;\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.\n*\n* ## Notes\n*\n* - Each provided ndarray should be an object with the following properties:\n*\n* - **dtype**: data type.\n* - **data**: data buffer.\n* - **shape**: dimensions.\n* - **strides**: stride lengths.\n* - **offset**: index offset.\n* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).\n*\n* @param {ArrayLikeObject} arrays - array-like object containing one input array and one output array\n* @param {Callback} fcn - callback function\n* @param {*} [thisArg] - callback execution context\n* @throws {Error} arrays must have the same number of dimensions\n* @throws {Error} arrays must have the same shape\n* @returns {void}\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map( [ x, y ], scale );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map( arrays, fcn, thisArg ) {\n\tvar ndims;\n\tvar shx;\n\tvar shy;\n\tvar iox;\n\tvar ioy;\n\tvar len;\n\tvar ord;\n\tvar x;\n\tvar y;\n\tvar i;\n\tvar d;\n\n\t// Unpack the ndarrays and standardize ndarray meta data:\n\tx = ndarray2object( arrays[ 0 ] );\n\ty = ndarray2object( arrays[ 1 ] );\n\n\t// Verify that the input and output arrays have the same number of dimensions...\n\tshx = x.shape;\n\tshy = y.shape;\n\tndims = shx.length;\n\tif ( ndims !== shy.length ) {\n\t\tthrow new Error( format( 'invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == %d. ndims(y) == %d.', ndims, shy.length ) );\n\t}\n\t// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\treturn ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg );\n\t\t}\n\t\treturn MAP[ ndims ]( x, y, fcn, thisArg );\n\t}\n\t// Verify that the input and output arrays have the same dimensions...\n\tlen = 1; // number of elements\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\td = shx[ i ];\n\t\tif ( d !== shy[ i ] ) {\n\t\t\tthrow new Error( 'invalid arguments. Arrays must have the same shape.' );\n\t\t}\n\t\t// Note that, if one of the dimensions is `0`, the length will be `0`...\n\t\tlen *= d;\n\t}\n\t// Check whether we were provided empty ndarrays...\n\tif ( len === 0 ) {\n\t\treturn;\n\t}\n\t// Determine whether the ndarrays are one-dimensional and thus readily translate to one-dimensional strided arrays...\n\tif ( ndims === 1 ) {\n\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\treturn ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg );\n\t\t}\n\t\treturn MAP[ ndims ]( x, y, fcn, thisArg );\n\t}\n\t// Determine iteration order:\n\tiox = iterationOrder( x.strides ); // +/-1\n\tioy = iterationOrder( y.strides ); // +/-1\n\n\t// Determine whether we can avoid blocked iteration...\n\tord = strides2order( x.strides );\n\tif ( iox !== 0 && ioy !== 0 && ord === strides2order( y.strides ) ) {\n\t\t// Determine whether we can use simple nested loops...\n\t\tif ( ndims <= MAX_DIMS ) {\n\t\t\t// So long as iteration for each respective array always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...\n\t\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_MAP[ ndims ]( x, y, ord === 1, fcn, thisArg );\n\t\t\t}\n\t\t\treturn MAP[ ndims ]( x, y, ord === 1, fcn, thisArg );\n\t\t}\n\t\t// Fall-through to blocked iteration...\n\t}\n\t// Determine whether we can perform blocked iteration...\n\tif ( ndims <= MAX_DIMS ) {\n\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\treturn BLOCKED_ACCESSOR_MAP[ ndims-2 ]( x, y, fcn, thisArg );\n\t\t}\n\t\treturn BLOCKED_MAP[ ndims-2 ]( x, y, fcn, thisArg );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\treturn accessormapnd( x, y, fcn, thisArg );\n\t}\n\tmapnd( x, y, fcn, thisArg );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a callback function to elements in an input ndarray and assign results to elements in an output ndarray.\n*\n* @module @stdlib/ndarray-base-map\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var map = require( '@stdlib/ndarray-base-map' );\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map( [ x, y ], scale );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "kIAAA,IAAAA,GAAAC,GAAA,SAAAC,GAAAC,GAAA,cAsBA,IAAIC,GAAY,QAAS,mDAAoD,EACzEC,GAAY,QAAS,8CAA+C,EACpEC,GAAO,QAAS,iCAAkC,EAClDC,GAAU,QAAS,4BAA6B,EAyFpD,SAASC,GAAcC,EAAGC,EAAGC,EAAKC,EAAU,CAC3C,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EA2BJ,IAtBAA,EAAIlC,GAAWK,EAAE,MAAOA,EAAE,QAASC,EAAE,OAAQ,EAC7Ce,EAAKa,EAAE,GACPV,EAAKU,EAAE,GACPT,EAAKS,EAAE,GACPhB,EAAMf,GAAS+B,EAAE,GAAI,EAGrBzB,EAAQR,GAAWI,EAAE,MAAOC,EAAE,KAAM,EAGpCoB,EAAKrB,EAAE,OACPsB,EAAKrB,EAAE,OAGP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C,IAAMtC,CACP,CACAqC,IAAM7C,EACN8C,IAAMrC,CACP,CACAoC,IAAM5C,EACN6C,IAAMpC,CACP,CACAmC,IAAM3C,EACN4C,IAAMnC,CACP,CACAkC,IAAM1C,EACN2C,IAAMlC,CACP,CACAiC,IAAMzC,EACN0C,IAAMjC,CACP,CAUV,CAKA9B,GAAO,QAAUK,KC5WjB,IAAA8E,GAAAC,GAAA,SAAAC,GAAAC,GAAA,cAwBA,IAAIC,GAAY,QAAS,mDAAoD,EACzEC,GAAY,QAAS,8CAA+C,EACpEC,GAAO,QAAS,iCAAkC,EAClDC,GAAU,QAAS,4BAA6B,EA2EpD,SAASC,GAAeC,EAAGC,EAAGC,EAAKC,EAAU,CAC5C,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GACAC,EACAC,EACAC,EACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GA2BJ,IAtBAA,GAAIxF,GAAWK,EAAE,MAAOA,EAAE,QAASC,EAAE,OAAQ,EAC7C6C,EAAKqC,GAAE,GACP1B,GAAK0B,GAAE,GACPzB,GAAKyB,GAAE,GACPtC,EAAM/C,GAASqF,GAAE,GAAI,EAGrB/E,EAAQR,GAAWI,EAAE,MAAOC,EAAE,KAAM,EAGpC0D,GAAK3D,EAAE,OACP4D,GAAK3D,EAAE,OAGPI,EAAOL,EAAE,KACTM,EAAOL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,kBAAoBC,EAAE,iBACrBd,GAAsBM,EAAM,CAAE,EAAGO,EAAGC,EAAGV,EAAKC,CAAQ,EAErDN,GAAaO,EAAM,CAAE,EAAGO,EAAGC,EAAGV,EAAKC,CAAQ,EAGnD,GAAKQ,EAAE,kBAAoBC,EAAE,iBAC5B,OAAO9B,GAAe6B,EAAGC,EAAGV,EAAKC,CAAQ,EAE1CT,GAAOiB,EAAGC,EAAGV,EAAKC,CAAQ,EAC3B,CAKAvD,GAAO,QAAUoD,KC3MjB,IAAIe,GAAO,KAKX,OAAO,QAAUA", - "names": ["require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap2d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dy0", "dy1", "ox1", "oy1", "idx", "get", "set", "sh", "s0", "s1", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "j0", "j1", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap3d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dy0", "dy1", "dy2", "ox1", "ox2", "oy1", "oy2", "idx", "get", "set", "sh", "s0", "s1", "s2", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "j0", "j1", "j2", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap4d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dy0", "dy1", "dy2", "dy3", "ox1", "ox2", "ox3", "idx", "oy1", "oy2", "oy3", "sh", "S0", "S1", "S2", "S3", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "j0", "j1", "j2", "j3", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap5d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dy0", "dy1", "dy2", "dy3", "dy4", "ox1", "ox2", "ox3", "ox4", "idx", "oy1", "oy2", "oy3", "oy4", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "j0", "j1", "j2", "j3", "j4", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap6d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "set", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "ox1", "ox2", "ox3", "ox4", "ox5", "oy1", "oy2", "oy3", "oy4", "oy5", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "j0", "j1", "j2", "j3", "j4", "j5", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap7d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap8d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "oy7", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap9d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "oy7", "oy8", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap10d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "dy9", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "ox9", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "oy7", "oy8", "oy9", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "j9", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap2d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dy0", "dy1", "ox1", "oy1", "idx", "sh", "s0", "s1", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "j0", "j1", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap3d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dy0", "dy1", "dy2", "ox1", "ox2", "oy1", "oy2", "idx", "sh", "s0", "s1", "s2", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "j0", "j1", "j2", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap4d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dy0", "dy1", "dy2", "dy3", "ox1", "ox2", "ox3", "idx", "oy1", "oy2", "oy3", "sh", "S0", "S1", "S2", "S3", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "j0", "j1", "j2", "j3", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap5d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dy0", "dy1", "dy2", "dy3", "dy4", "ox1", "ox2", "ox3", "ox4", "idx", "oy1", "oy2", "oy3", "oy4", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "j0", "j1", "j2", "j3", "j4", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap6d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "ox1", "ox2", "ox3", "ox4", "ox5", "oy1", "oy2", "oy3", "oy4", "oy5", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "j0", "j1", "j2", "j3", "j4", "j5", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap7d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap8d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "oy7", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap9d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "oy7", "oy8", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedmap10d", "x", "y", "fcn", "thisArg", "bsize", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "dy9", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "ox9", "oy1", "oy2", "oy3", "oy4", "oy5", "oy6", "oy7", "oy8", "oy9", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "sy", "ox", "oy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "j9", "o", "require_d_accessors", "__commonJSMin", "exports", "module", "map0d", "x", "y", "fcn", "thisArg", "require_d_accessors", "__commonJSMin", "exports", "module", "map1d", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dy0", "S0", "ix", "iy", "i0", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map2d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dy0", "dy1", "idx", "sh", "S0", "S1", "sx", "sy", "ix", "iy", "i0", "i1", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map3d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dy0", "dy1", "dy2", "idx", "get", "set", "sh", "S0", "S1", "S2", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map4d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dy0", "dy1", "dy2", "dy3", "idx", "sh", "S0", "S1", "S2", "S3", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map5d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dy0", "dy1", "dy2", "dy3", "dy4", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map6d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map7d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map8d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map9d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "require_d_accessors", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map10d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "dy9", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "require_nd_accessors", "__commonJSMin", "exports", "module", "numel", "vind2bind", "ind2sub", "MODE", "mapnd", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "ordx", "ordy", "len", "get", "set", "idx", "sh", "sx", "sy", "ox", "oy", "ix", "iy", "i", "require_d", "__commonJSMin", "exports", "module", "map0d", "x", "y", "fcn", "thisArg", "require_d", "__commonJSMin", "exports", "module", "map1d", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dy0", "S0", "ix", "iy", "i0", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map2d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dy0", "dy1", "idx", "sh", "S0", "S1", "sx", "sy", "ix", "iy", "i0", "i1", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map3d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dy0", "dy1", "dy2", "idx", "sh", "S0", "S1", "S2", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map4d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dy0", "dy1", "dy2", "dy3", "idx", "sh", "S0", "S1", "S2", "S3", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map5d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dy0", "dy1", "dy2", "dy3", "dy4", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map6d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map7d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map8d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map9d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "require_d", "__commonJSMin", "exports", "module", "zeroTo", "reverse", "take", "map10d", "x", "y", "isRowMajor", "fcn", "thisArg", "xbuf", "ybuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "dy0", "dy1", "dy2", "dy3", "dy4", "dy5", "dy6", "dy7", "dy8", "dy9", "idx", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "sy", "ix", "iy", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "require_nd", "__commonJSMin", "exports", "module", "numel", "vind2bind", "ind2sub", "MODE", "mapnd", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "ordx", "ordy", "len", "idx", "sh", "sx", "sy", "ox", "oy", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "iterationOrder", "strides2order", "ndarray2object", "format", "blockedaccessormap2d", "blockedaccessormap3d", "blockedaccessormap4d", "blockedaccessormap5d", "blockedaccessormap6d", "blockedaccessormap7d", "blockedaccessormap8d", "blockedaccessormap9d", "blockedaccessormap10d", "blockedmap2d", "blockedmap3d", "blockedmap4d", "blockedmap5d", "blockedmap6d", "blockedmap7d", "blockedmap8d", "blockedmap9d", "blockedmap10d", "accessormap0d", "accessormap1d", "accessormap2d", "accessormap3d", "accessormap4d", "accessormap5d", "accessormap6d", "accessormap7d", "accessormap8d", "accessormap9d", "accessormap10d", "accessormapnd", "map0d", "map1d", "map2d", "map3d", "map4d", "map5d", "map6d", "map7d", "map8d", "map9d", "map10d", "mapnd", "MAP", "ACCESSOR_MAP", "BLOCKED_MAP", "BLOCKED_ACCESSOR_MAP", "MAX_DIMS", "map", "arrays", "fcn", "thisArg", "ndims", "shx", "shy", "iox", "ioy", "len", "ord", "x", "y", "i", "d", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index be30da1..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,78 +0,0 @@ - -{{alias}}( arrays, fcn[, thisArg] ) - Applies a callback function to elements in an input ndarray and assigns - results to elements in an output ndarray. - - Each provided "ndarray" should be an object with following properties: - - - dtype: data type. - - data: data buffer. - - shape: dimensions. - - strides: stride lengths. - - offset: index offset. - - order: specifies whether an ndarray is row-major (C-style) or column-major - (Fortran-style). - - The callback function is provided the following arguments: - - - value: current array element. - - indices: current array element indices. - - arr: the input ndarray. - - Parameters - ---------- - arrays: ArrayLikeObject - Array-like object containing one input ndarray and one output ndarray. - - fcn: Function - Callback function. - - thisArg: any (optional) - Callback function execution context. - - Examples - -------- - // Define ndarray data and meta data... - > var xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var ybuf = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); - > var dtype = 'float64'; - > var shape = [ 2, 2 ]; - > var sx = [ 2, 1 ]; - > var sy = [ 2, 1 ]; - > var ox = 0; - > var oy = 0; - > var order = 'row-major'; - - // Define a callback function: - > function f( v ) { return v*10.0; }; - - // Using ndarrays... - > var x = {{alias:@stdlib/ndarray/ctor}}( dtype, xbuf, shape, sx, ox, order ); - > var y = {{alias:@stdlib/ndarray/ctor}}( dtype, ybuf, shape, sy, oy, order ); - > {{alias}}( [ x, y ], f ); - > y.data - [ 10.0, 20.0, 30.0, 40.0 ] - - // Using minimal ndarray-like objects... - > x = { - ... 'dtype': dtype, - ... 'data': xbuf, - ... 'shape': shape, - ... 'strides': sx, - ... 'offset': ox, - ... 'order': order - ... }; - > y = { - ... 'dtype': dtype, - ... 'data': ybuf, - ... 'shape': shape, - ... 'strides': sy, - ... 'offset': oy, - ... 'order': order - ... }; - > {{alias}}( [ x, y ], f ); - > y.data - [ 10.0, 20.0, 30.0, 40.0 ] - - See Also - -------- diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 7f4af9e..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zeros = require( '@stdlib/ndarray-zeros' ); -import map = require( './index' ); - -/** -* Evaluates the identity function. -* -* @param x - input value -* @returns input value -*/ -function identity( x: number ): number { - return x; -} - -// TESTS // - -// The function returns `undefined`... -{ - const x = zeros( [ 2, 2 ] ); - const y = zeros( [ 2, 2 ] ); - - map( [ x, y ], identity ); // $ExpectType void - map( [ x, y ], identity, {} ); // $ExpectType void -} - -// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects... -{ - map( 5, identity ); // $ExpectError - map( true, identity ); // $ExpectError - map( false, identity ); // $ExpectError - map( null, identity ); // $ExpectError - map( undefined, identity ); // $ExpectError - map( {}, identity ); // $ExpectError - map( [ 1 ], identity ); // $ExpectError - map( ( x: number ): number => x, identity ); // $ExpectError - - map( 5, identity, {} ); // $ExpectError - map( true, identity, {} ); // $ExpectError - map( false, identity, {} ); // $ExpectError - map( null, identity, {} ); // $ExpectError - map( undefined, identity, {} ); // $ExpectError - map( {}, identity, {} ); // $ExpectError - map( [ 1 ], identity, {} ); // $ExpectError - map( ( x: number ): number => x, identity, {} ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a callback function... -{ - const x = zeros( [ 2, 2 ] ); - const y = zeros( [ 2, 2 ] ); - - map( [ x, y ], '10' ); // $ExpectError - map( [ x, y ], 5 ); // $ExpectError - map( [ x, y ], true ); // $ExpectError - map( [ x, y ], false ); // $ExpectError - map( [ x, y ], null ); // $ExpectError - map( [ x, y ], undefined ); // $ExpectError - map( [ x, y ], [] ); // $ExpectError - map( [ x, y ], {} ); // $ExpectError - - map( [ x, y ], '10', {} ); // $ExpectError - map( [ x, y ], 5, {} ); // $ExpectError - map( [ x, y ], true, {} ); // $ExpectError - map( [ x, y ], false, {} ); // $ExpectError - map( [ x, y ], null, {} ); // $ExpectError - map( [ x, y ], undefined, {} ); // $ExpectError - map( [ x, y ], [], {} ); // $ExpectError - map( [ x, y ], {}, {} ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const x = zeros( [ 2, 2 ] ); - const y = zeros( [ 2, 2 ] ); - - map(); // $ExpectError - map( [ x, y ] ); // $ExpectError{ - map( [ x, y ], identity, {}, {} ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index e390790..0000000 --- a/examples/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var zeros = require( '@stdlib/array-zeros' ); -var abs = require( '@stdlib/math-base-special-abs' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var ndarray2array = require( '@stdlib/ndarray-base-to-array' ); -var naryFunction = require( '@stdlib/utils-nary-function' ); -var map = require( './../lib' ); - -var N = 10; -var x = { - 'dtype': 'generic', - 'data': discreteUniform( N, -100, 100, { - 'dtype': 'generic' - }), - 'shape': [ 5, 2 ], - 'strides': [ 2, 1 ], - 'offset': 0, - 'order': 'row-major' -}; -var y = { - 'dtype': 'generic', - 'data': zeros( N, 'generic' ), - 'shape': x.shape.slice(), - 'strides': shape2strides( x.shape, 'column-major' ), - 'offset': 0, - 'order': 'column-major' -}; - -map( [ x, y ], naryFunction( abs, 1 ) ); -console.log( ndarray2array( x.data, x.shape, x.strides, x.offset, x.order ) ); -console.log( ndarray2array( y.data, y.shape, y.strides, y.offset, y.order ) ); diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 97% rename from docs/types/index.d.ts rename to index.d.ts index 9637c28..6cc94ad 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { typedndarray } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..9172169 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import r from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-iteration-order@v0.2.3-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-strides2order@v0.2.3-esm/index.mjs";import o from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-ndarraylike2object@v0.2.3-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.3-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-unary-loop-interchange-order@v0.3.1-esm/index.mjs";import t from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-unary-tiling-block-size@v0.2.3-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-take-indexed@v0.2.3-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-reverse@v0.2.3-esm/index.mjs";import i from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-unary-tiling-block-size@esm/index.mjs";import c from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-reverse@esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-unary-loop-interchange-order@esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zero-to@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zero-to@esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-numel@esm/index.mjs";import v from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-vind2bind@esm/index.mjs";import y from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-ind2sub@esm/index.mjs";var m="throw";var u="throw";var x=[function(r,s,o,f){s.data[s.offset]=o.call(f,r.data[r.offset],[],r.ref)},function(r,s,o,f){var e,t,a,d,i,c,n,l;for(i=r.shape[0],a=r.strides[0],d=s.strides[0],c=r.offset,n=s.offset,e=r.data,t=s.data,l=0;l0;)for(C0;)for(B0;)for(K0;)for(J0;)for(I0;)for(S0;)for(R0;)for(Q0;)for(O0;)for(Z0;)for(Y0;)for(X0;)for(W0;)for(V0;)for(er0;)for(fr0;)for(or0;)for(sr0;)for(rr0;)for(_0;)for(lr0;)for(nr0;)for(cr0;)for(ir0;)for(dr0;)for(ar0;)for(tr0;)for(xr0;)for(ur0;)for(mr0;)for(yr0;)for(vr0;)for(pr0;)for(hr0;)for(lr0;)for(zr0;)for(kr0;)for(wr0;)for(Pr0;)for(br0;)for(gr0;)for(jr0;)for(xr0;)for(ur0;)for(Fr0;)for(Dr0;)for(Cr0;)for(Br0;)for(qr0;)for(Ar0;)for(Er0;)for(zr0;)for(kr0;)for(wr0;)for(F0;)for(D0;)for(M0;)for(L0;)for(K0;)for(U0;)for(T0;)for(S0;)for(R0;)for(_0;)for($0;)for(Z0;)for(Y0;)for(X0;)for(ar0;)for(tr0;)for(er0;)for(fr0;)for(or0;)for(sr0;)for(pr0;)for(hr0;)for(lr0;)for(nr0;)for(cr0;)for(ir0;)for(dr0;)for(gr0;)for(jr0;)for(xr0;)for(ur0;)for(mr0;)for(yr0;)for(vr0;)for(pr0;)for(Ar0;)for(Er0;)for(zr0;)for(kr0;)for(wr0;)for(Pr0;)for(br0;)for(gr0;)for(jr0;)for(Hr0;)for(Gr0;)for(Fr0;)for(Dr0;)for(Cr0;)for(Br0;)for(qr0;)for(Ar0;)for(Er0;)for(zr} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* mapnd( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction mapnd( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar get;\n\tvar set;\n\tvar idx;\n\tvar sh;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( sh, sy, oy, ordy, i, MODE );\n\t\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), idx, x.ref ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default mapnd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\nimport ind2sub from '@stdlib/ndarray-base-ind2sub';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an n-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* mapnd( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0 ]\n*/\nfunction mapnd( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar idx;\n\tvar sh;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( sh, sy, oy, ordy, i, MODE );\n\t\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], idx, x.ref );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default mapnd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport iterationOrder from '@stdlib/ndarray-base-iteration-order';\nimport strides2order from '@stdlib/ndarray-base-strides2order';\nimport ndarray2object from '@stdlib/ndarray-base-ndarraylike2object';\nimport format from '@stdlib/error-tools-fmtprodmsg';\nimport blockedaccessormap2d from './2d_blocked_accessors.js';\nimport blockedaccessormap3d from './3d_blocked_accessors.js';\nimport blockedaccessormap4d from './4d_blocked_accessors.js';\nimport blockedaccessormap5d from './5d_blocked_accessors.js';\nimport blockedaccessormap6d from './6d_blocked_accessors.js';\nimport blockedaccessormap7d from './7d_blocked_accessors.js';\nimport blockedaccessormap8d from './8d_blocked_accessors.js';\nimport blockedaccessormap9d from './9d_blocked_accessors.js';\nimport blockedaccessormap10d from './10d_blocked_accessors.js';\nimport blockedmap2d from './2d_blocked.js';\nimport blockedmap3d from './3d_blocked.js';\nimport blockedmap4d from './4d_blocked.js';\nimport blockedmap5d from './5d_blocked.js';\nimport blockedmap6d from './6d_blocked.js';\nimport blockedmap7d from './7d_blocked.js';\nimport blockedmap8d from './8d_blocked.js';\nimport blockedmap9d from './9d_blocked.js';\nimport blockedmap10d from './10d_blocked.js';\nimport accessormap0d from './0d_accessors.js';\nimport accessormap1d from './1d_accessors.js';\nimport accessormap2d from './2d_accessors.js';\nimport accessormap3d from './3d_accessors.js';\nimport accessormap4d from './4d_accessors.js';\nimport accessormap5d from './5d_accessors.js';\nimport accessormap6d from './6d_accessors.js';\nimport accessormap7d from './7d_accessors.js';\nimport accessormap8d from './8d_accessors.js';\nimport accessormap9d from './9d_accessors.js';\nimport accessormap10d from './10d_accessors.js';\nimport accessormapnd from './nd_accessors.js';\nimport map0d from './0d.js';\nimport map1d from './1d.js';\nimport map2d from './2d.js';\nimport map3d from './3d.js';\nimport map4d from './4d.js';\nimport map5d from './5d.js';\nimport map6d from './6d.js';\nimport map7d from './7d.js';\nimport map8d from './8d.js';\nimport map9d from './9d.js';\nimport map10d from './10d.js';\nimport mapnd from './nd.js';\n\n\n// VARIABLES //\n\nvar MAP = [\n\tmap0d,\n\tmap1d,\n\tmap2d,\n\tmap3d,\n\tmap4d,\n\tmap5d,\n\tmap6d,\n\tmap7d,\n\tmap8d,\n\tmap9d,\n\tmap10d\n];\nvar ACCESSOR_MAP = [\n\taccessormap0d,\n\taccessormap1d,\n\taccessormap2d,\n\taccessormap3d,\n\taccessormap4d,\n\taccessormap5d,\n\taccessormap6d,\n\taccessormap7d,\n\taccessormap8d,\n\taccessormap9d,\n\taccessormap10d\n];\nvar BLOCKED_MAP = [\n\tblockedmap2d, // 0\n\tblockedmap3d,\n\tblockedmap4d,\n\tblockedmap5d,\n\tblockedmap6d,\n\tblockedmap7d,\n\tblockedmap8d,\n\tblockedmap9d,\n\tblockedmap10d // 8\n];\nvar BLOCKED_ACCESSOR_MAP = [\n\tblockedaccessormap2d, // 0\n\tblockedaccessormap3d,\n\tblockedaccessormap4d,\n\tblockedaccessormap5d,\n\tblockedaccessormap6d,\n\tblockedaccessormap7d,\n\tblockedaccessormap8d,\n\tblockedaccessormap9d,\n\tblockedaccessormap10d // 8\n];\nvar MAX_DIMS = MAP.length -1;\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.\n*\n* ## Notes\n*\n* - Each provided ndarray should be an object with the following properties:\n*\n* - **dtype**: data type.\n* - **data**: data buffer.\n* - **shape**: dimensions.\n* - **strides**: stride lengths.\n* - **offset**: index offset.\n* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).\n*\n* @param {ArrayLikeObject} arrays - array-like object containing one input array and one output array\n* @param {Callback} fcn - callback function\n* @param {*} [thisArg] - callback execution context\n* @throws {Error} arrays must have the same number of dimensions\n* @throws {Error} arrays must have the same shape\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map( [ x, y ], scale );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map( arrays, fcn, thisArg ) {\n\tvar ndims;\n\tvar shx;\n\tvar shy;\n\tvar iox;\n\tvar ioy;\n\tvar len;\n\tvar ord;\n\tvar x;\n\tvar y;\n\tvar i;\n\tvar d;\n\n\t// Unpack the ndarrays and standardize ndarray meta data:\n\tx = ndarray2object( arrays[ 0 ] );\n\ty = ndarray2object( arrays[ 1 ] );\n\n\t// Verify that the input and output arrays have the same number of dimensions...\n\tshx = x.shape;\n\tshy = y.shape;\n\tndims = shx.length;\n\tif ( ndims !== shy.length ) {\n\t\tthrow new Error( format( 'invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == %d. ndims(y) == %d.', ndims, shy.length ) );\n\t}\n\t// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\treturn ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg );\n\t\t}\n\t\treturn MAP[ ndims ]( x, y, fcn, thisArg );\n\t}\n\t// Verify that the input and output arrays have the same dimensions...\n\tlen = 1; // number of elements\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\td = shx[ i ];\n\t\tif ( d !== shy[ i ] ) {\n\t\t\tthrow new Error( format('null0d') );\n\t\t}\n\t\t// Note that, if one of the dimensions is `0`, the length will be `0`...\n\t\tlen *= d;\n\t}\n\t// Check whether we were provided empty ndarrays...\n\tif ( len === 0 ) {\n\t\treturn;\n\t}\n\t// Determine whether the ndarrays are one-dimensional and thus readily translate to one-dimensional strided arrays...\n\tif ( ndims === 1 ) {\n\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\treturn ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg );\n\t\t}\n\t\treturn MAP[ ndims ]( x, y, fcn, thisArg );\n\t}\n\t// Determine iteration order:\n\tiox = iterationOrder( x.strides ); // +/-1\n\tioy = iterationOrder( y.strides ); // +/-1\n\n\t// Determine whether we can avoid blocked iteration...\n\tord = strides2order( x.strides );\n\tif ( iox !== 0 && ioy !== 0 && ord === strides2order( y.strides ) ) {\n\t\t// Determine whether we can use simple nested loops...\n\t\tif ( ndims <= MAX_DIMS ) {\n\t\t\t// So long as iteration for each respective array always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...\n\t\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_MAP[ ndims ]( x, y, ord === 1, fcn, thisArg );\n\t\t\t}\n\t\t\treturn MAP[ ndims ]( x, y, ord === 1, fcn, thisArg );\n\t\t}\n\t\t// Fall-through to blocked iteration...\n\t}\n\t// Determine whether we can perform blocked iteration...\n\tif ( ndims <= MAX_DIMS ) {\n\t\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\t\treturn BLOCKED_ACCESSOR_MAP[ ndims-2 ]( x, y, fcn, thisArg );\n\t\t}\n\t\treturn BLOCKED_MAP[ ndims-2 ]( x, y, fcn, thisArg );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol || y.accessorProtocol ) {\n\t\treturn accessormapnd( x, y, fcn, thisArg );\n\t}\n\tmapnd( x, y, fcn, thisArg );\n}\n\n\n// EXPORTS //\n\nexport default map;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a zero-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ){\n* return z * 10.0;\n* }\n*\n* // Create a data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n* var ybuf = new Float64Array( 1 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n* var sy = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* }\n*\n* // Apply function:\n* map0d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0 ]\n*/\nfunction map0d( x, y, fcn, thisArg ) {\n\ty.data[ y.offset ] = fcn.call( thisArg, x.data[ x.offset ], [], x.ref );\n}\n\n\n// EXPORTS //\n\nexport default map0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a one-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n* var sy = [ 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map1d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 40.0, 60.0, 80.0 ]\n*/\nfunction map1d( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dy0;\n\tvar S0;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\tdy0 = y.strides[ 0 ];\n\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], [ i0 ], x.ref );\n\t\tix += dx0;\n\t\tiy += dy0;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map2d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0 ]\n*/\nfunction map2d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for the outermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 1 ];\n\t\tdy1 = sy[ 0 ] - ( S0*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for outermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sx[0] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointer to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\tix += dx0;\n\t\t\tiy += dy0;\n\t\t}\n\t\tix += dx1;\n\t\tiy += dy1;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map3d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map3d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 2 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[2] );\n\t\tdy2 = sy[ 0 ] - ( S1*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\tix += dx0;\n\t\t\t\tiy += dy0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t\tiy += dy1;\n\t\t}\n\t\tix += dx2;\n\t\tiy += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n* var sy = [ 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map4d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map4d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 3 ];\n\t\tdy1 = sy[ 2 ] - ( S0*sy[3] );\n\t\tdy2 = sy[ 1 ] - ( S1*sy[2] );\n\t\tdy3 = sy[ 0 ] - ( S2*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t\tiy += dy2;\n\t\t}\n\t\tix += dx3;\n\t\tiy += dy3;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map5d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map5d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 4 ];\n\t\tdy1 = sy[ 3 ] - ( S0*sy[4] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[3] );\n\t\tdy3 = sy[ 1 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 0 ] - ( S3*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t\tiy += dy1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t\tiy += dy2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t\tiy += dy3;\n\t\t}\n\t\tix += dx4;\n\t\tiy += dy4;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map6d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map6d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 5 ];\n\t\tdy1 = sy[ 4 ] - ( S0*sy[5] );\n\t\tdy2 = sy[ 3 ] - ( S1*sy[4] );\n\t\tdy3 = sy[ 2 ] - ( S2*sy[3] );\n\t\tdy4 = sy[ 1 ] - ( S3*sy[2] );\n\t\tdy5 = sy[ 0 ] - ( S4*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t\tiy += dy3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t\tiy += dy4;\n\t\t}\n\t\tix += dx5;\n\t\tiy += dy5;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map7d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 6 ];\n\t\tdy1 = sy[ 5 ] - ( S0*sy[6] );\n\t\tdy2 = sy[ 4 ] - ( S1*sy[5] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[4] );\n\t\tdy4 = sy[ 2 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 1 ] - ( S4*sy[2] );\n\t\tdy6 = sy[ 0 ] - ( S5*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t\tiy += dy3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t\tiy += dy4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t\tiy += dy5;\n\t\t}\n\t\tix += dx6;\n\t\tiy += dy6;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map8d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 7 ];\n\t\tdy1 = sy[ 6 ] - ( S0*sy[7] );\n\t\tdy2 = sy[ 5 ] - ( S1*sy[6] );\n\t\tdy3 = sy[ 4 ] - ( S2*sy[5] );\n\t\tdy4 = sy[ 3 ] - ( S3*sy[4] );\n\t\tdy5 = sy[ 2 ] - ( S4*sy[3] );\n\t\tdy6 = sy[ 1 ] - ( S5*sy[2] );\n\t\tdy7 = sy[ 0 ] - ( S6*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t\tiy += dy4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t\tiy += dy5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t\tiy += dy6;\n\t\t}\n\t\tix += dx7;\n\t\tiy += dy7;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map9d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 8 ];\n\t\tdy1 = sy[ 7 ] - ( S0*sy[8] );\n\t\tdy2 = sy[ 6 ] - ( S1*sy[7] );\n\t\tdy3 = sy[ 5 ] - ( S2*sy[6] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[5] );\n\t\tdy5 = sy[ 3 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 2 ] - ( S5*sy[3] );\n\t\tdy7 = sy[ 1 ] - ( S6*sy[2] );\n\t\tdy8 = sy[ 0 ] - ( S7*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t\tiy += dy5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t\tiy += dy6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t\tiy += dy7;\n\t\t}\n\t\tix += dx8;\n\t\tiy += dy8;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* map10d( x, y, true, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 9 ];\n\t\tdy1 = sy[ 8 ] - ( S0*sy[9] );\n\t\tdy2 = sy[ 7 ] - ( S1*sy[8] );\n\t\tdy3 = sy[ 6 ] - ( S2*sy[7] );\n\t\tdy4 = sy[ 5 ] - ( S3*sy[6] );\n\t\tdy5 = sy[ 4 ] - ( S4*sy[5] );\n\t\tdy6 = sy[ 3 ] - ( S5*sy[4] );\n\t\tdy7 = sy[ 2 ] - ( S6*sy[3] );\n\t\tdy8 = sy[ 1 ] - ( S7*sy[2] );\n\t\tdy9 = sy[ 0 ] - ( S8*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tdy9 = sy[ 9 ] - ( S8*sy[8] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t\tiy += dy6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t\tiy += dy7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t\tiy += dy8;\n\t\t}\n\t\tix += dx9;\n\t\tiy += dy9;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a zero-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );\n* var ybuf = new Complex64Array( 2 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n* var sy = [ 0 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map0d( x, y, scale, {} );\n* // ybuf => [ 30.0, 40.0, 0.0, 0.0 ]\n*/\nfunction map0d( x, y, fcn, thisArg ) {\n\ty.accessors[ 1 ]( y.data, y.offset, fcn.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default map0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a one-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 1 ];\n* var sy = [ 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map1d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map1d( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dy0;\n\tvar S0;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\tdy0 = y.strides[ 0 ];\n\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), [ i0 ], x.ref ) );\n\t\tix += dx0;\n\t\tiy += dy0;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map2d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map2d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for the outermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 1 ];\n\t\tdy1 = sy[ 0 ] - ( S0*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for outermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for innermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sx[0] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointer to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\tix += dx0;\n\t\t\tiy += dy0;\n\t\t}\n\t\tix += dx1;\n\t\tiy += dy1;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n* var sy = [ 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map3d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map3d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar idx;\n\tvar get;\n\tvar set;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 2 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[2] );\n\t\tdy2 = sy[ 0 ] - ( S1*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\tix += dx0;\n\t\t\t\tiy += dy0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t\tiy += dy1;\n\t\t}\n\t\tix += dx2;\n\t\tiy += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map4d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map4d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 3 ];\n\t\tdy1 = sy[ 2 ] - ( S0*sy[3] );\n\t\tdy2 = sy[ 1 ] - ( S1*sy[2] );\n\t\tdy3 = sy[ 0 ] - ( S2*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t\tiy += dy2;\n\t\t}\n\t\tix += dx3;\n\t\tiy += dy3;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map5d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map5d( x, y, isRowMajor, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 4 ];\n\t\tdy1 = sy[ 3 ] - ( S0*sy[4] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[3] );\n\t\tdy3 = sy[ 1 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 0 ] - ( S3*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t\tiy += dy1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t\tiy += dy2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t\tiy += dy3;\n\t\t}\n\t\tix += dx4;\n\t\tiy += dy4;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map6d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map6d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 5 ];\n\t\tdy1 = sy[ 4 ] - ( S0*sy[5] );\n\t\tdy2 = sy[ 3 ] - ( S1*sy[4] );\n\t\tdy3 = sy[ 2 ] - ( S2*sy[3] );\n\t\tdy4 = sy[ 1 ] - ( S3*sy[2] );\n\t\tdy5 = sy[ 0 ] - ( S4*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t\tiy += dy3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t\tiy += dy4;\n\t\t}\n\t\tix += dx5;\n\t\tiy += dy5;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map7d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 6 ];\n\t\tdy1 = sy[ 5 ] - ( S0*sy[6] );\n\t\tdy2 = sy[ 4 ] - ( S1*sy[5] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[4] );\n\t\tdy4 = sy[ 2 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 1 ] - ( S4*sy[2] );\n\t\tdy6 = sy[ 0 ] - ( S5*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t\tiy += dy3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t\tiy += dy4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t\tiy += dy5;\n\t\t}\n\t\tix += dx6;\n\t\tiy += dy6;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map8d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 7 ];\n\t\tdy1 = sy[ 6 ] - ( S0*sy[7] );\n\t\tdy2 = sy[ 5 ] - ( S1*sy[6] );\n\t\tdy3 = sy[ 4 ] - ( S2*sy[5] );\n\t\tdy4 = sy[ 3 ] - ( S3*sy[4] );\n\t\tdy5 = sy[ 2 ] - ( S4*sy[3] );\n\t\tdy6 = sy[ 1 ] - ( S5*sy[2] );\n\t\tdy7 = sy[ 0 ] - ( S6*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t\tiy += dy4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t\tiy += dy5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t\tiy += dy6;\n\t\t}\n\t\tix += dx7;\n\t\tiy += dy7;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map9d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 8 ];\n\t\tdy1 = sy[ 7 ] - ( S0*sy[8] );\n\t\tdy2 = sy[ 6 ] - ( S1*sy[7] );\n\t\tdy3 = sy[ 5 ] - ( S2*sy[6] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[5] );\n\t\tdy5 = sy[ 3 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 2 ] - ( S5*sy[3] );\n\t\tdy7 = sy[ 1 ] - ( S6*sy[2] );\n\t\tdy8 = sy[ 0 ] - ( S7*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t\tiy += dy5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t\tiy += dy6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t\tiy += dy7;\n\t\t}\n\t\tix += dx8;\n\t\tiy += dy8;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* map10d( x, y, true, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tsy = y.strides;\n\tidx = zeroTo( sh.length );\n\tif ( isRowMajor ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 9 ];\n\t\tdy1 = sy[ 8 ] - ( S0*sy[9] );\n\t\tdy2 = sy[ 7 ] - ( S1*sy[8] );\n\t\tdy3 = sy[ 6 ] - ( S2*sy[7] );\n\t\tdy4 = sy[ 5 ] - ( S3*sy[6] );\n\t\tdy5 = sy[ 4 ] - ( S4*sy[5] );\n\t\tdy6 = sy[ 3 ] - ( S5*sy[4] );\n\t\tdy7 = sy[ 2 ] - ( S6*sy[3] );\n\t\tdy8 = sy[ 1 ] - ( S7*sy[2] );\n\t\tdy9 = sy[ 0 ] - ( S8*sy[1] );\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t\tdy0 = sy[ 0 ];\n\t\tdy1 = sy[ 1 ] - ( S0*sy[0] );\n\t\tdy2 = sy[ 2 ] - ( S1*sy[1] );\n\t\tdy3 = sy[ 3 ] - ( S2*sy[2] );\n\t\tdy4 = sy[ 4 ] - ( S3*sy[3] );\n\t\tdy5 = sy[ 5 ] - ( S4*sy[4] );\n\t\tdy6 = sy[ 6 ] - ( S5*sy[5] );\n\t\tdy7 = sy[ 7 ] - ( S6*sy[6] );\n\t\tdy8 = sy[ 8 ] - ( S7*sy[7] );\n\t\tdy9 = sy[ 9 ] - ( S8*sy[8] );\n\t\tidx = reverse( idx );\n\t}\n\t// Set the pointers to the first indexed elements in the respective ndarrays...\n\tix = x.offset;\n\tiy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t\tiy += dy6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t\tiy += dy7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t\tiy += dy8;\n\t\t}\n\t\tix += dx9;\n\t\tiy += dy9;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default map10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Float64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap2d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0 ]\n*/\nfunction blockedmap2d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar ox1;\n\tvar oy1;\n\tvar idx;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\toy1 = oy + ( j1*sy[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offsets for the first input and output ndarray elements in the current block...\n\t\t\tix = ox1 + (j0*sx[0]);\n\t\t\tiy = oy1 + (j0*sy[0]);\n\n\t\t\t// Compute the loop offset increments...\n\t\t\tdx1 = sx[1] - (s0*sx[0]);\n\t\t\tdy1 = sy[1] - (s0*sy[0]);\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap3d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap3d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar ox1;\n\tvar ox2;\n\tvar oy1;\n\tvar oy2;\n\tvar idx;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\toy2 = oy + ( j2*sy[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tdy2 = sy[2] - ( s1*sy[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t// Compute loop offset increments...\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\t\t\t\tdy1 = sy[1] - ( s0*sy[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n* var sy = [ 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap4d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\tS3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\tS3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\toy3 = oy + ( j3*sy[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\tS2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\tS2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\tS1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap5d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\tS4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\tS4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\toy4 = oy + ( j4*sy[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\tS3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\tS3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\tS2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap6d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\tS5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\tS5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\toy5 = oy + ( j5*sy[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\tS4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\tS4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\tS3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap7d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\tS6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\tS6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\toy6 = oy + ( j6*sy[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\tS5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\tS5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\tS4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap8d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\tS7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\tS7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\toy7 = oy + ( j7*sy[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\tS6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\tS6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\tS5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap9d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\tS8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\tS8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\toy8 = oy + ( j8*sy[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\tS7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\tS7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\tS6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t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t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function scale( z ) {\n* return z * 10.0;\n* }\n*\n* // Create data buffers:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var ybuf = new Float64Array( 6 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n* var sy = [ 6, 6, 6, 6, 6, 6, 6, 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 1;\n* var oy = 0;\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n* var y = {\n* 'dtype': 'float64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major'\n* };\n*\n* // Apply function:\n* blockedmap10d( x, y, scale, {} );\n*\n* console.log( y.data );\n* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]\n*/\nfunction blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar oy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\tS9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\tS9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\toy9 = oy + ( j9*sy[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\tS8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\tS8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( S8*sx[8] );\n\t\t\tdy9 = sy[9] - ( S8*sy[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\toy8 = oy9 + ( j8*sy[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\tS7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\tS6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j9+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n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap2d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap2d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar ox1;\n\tvar oy1;\n\tvar idx;\n\tvar get;\n\tvar set;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\toy1 = oy + ( j1*sy[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offsets for the first input and output ndarray elements in the current block...\n\t\t\tix = ox1 + (j0*sx[0]);\n\t\t\tiy = oy1 + (j0*sy[0]);\n\n\t\t\t// Compute the loop offset increments...\n\t\t\tdx1 = sx[1] - (s0*sx[0]);\n\t\t\tdy1 = sy[1] - (s0*sy[0]);\n\n\t\t\t// Cache accessors:\n\t\t\tget = x.accessors[0];\n\t\t\tset = y.accessors[1];\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\tix += dx0;\n\t\t\t\t\tiy += dy0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t\tiy += dy1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 2, 1 ];\n* var sy = [ 2, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap3d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap3d( x, y, fcn, thisArg ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar ox1;\n\tvar ox2;\n\tvar oy1;\n\tvar oy2;\n\tvar idx;\n\tvar get;\n\tvar set;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\toy2 = oy + ( j2*sy[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tdy2 = sy[2] - ( s1*sy[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t// Compute loop offset increments...\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\t\t\t\tdy1 = sy[1] - ( s0*sy[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t\tiy += dy2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap4d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\tS3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\tS3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\toy3 = oy + ( j3*sy[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\tS2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\tS2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\tS1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t// Cache accessors:\n\t\t\t\t\tget = x.accessors[ 0 ];\n\t\t\t\t\tset = y.accessors[ 1 ];\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap5d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar idx;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\tS4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\tS4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\toy4 = oy + ( j4*sy[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\tS3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\tS3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\tS2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap6d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\tS5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\tS5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\toy5 = oy + ( j5*sy[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\tS4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\tS4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\tS3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap7d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\tS6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\tS6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\toy6 = oy + ( j6*sy[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\tS5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\tS5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\tS4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap8d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\tS7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\tS7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\toy7 = oy + ( j7*sy[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\tS6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\tS6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\tS5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap9d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\tS8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\tS8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\toy8 = oy + ( j8*sy[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\tS7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\tS7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\tS6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\tiy += dy6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\tiy += dy8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-unary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-unary-tiling-block-size';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @param {Object} y - object containing output ndarray meta data\n* @param {*} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - data buffer accessors\n* @param {Callback} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {void}\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n* var sy = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply function:\n* blockedmap10d( x, y, scale, {} );\n* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ]\n*/\nfunction blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar dy5;\n\tvar dy6;\n\tvar dy7;\n\tvar dy8;\n\tvar dy9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar oy1;\n\tvar oy2;\n\tvar oy3;\n\tvar oy4;\n\tvar oy5;\n\tvar oy6;\n\tvar oy7;\n\tvar oy8;\n\tvar oy9;\n\tvar idx;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides, y.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\tsy = o.sy;\n\tidx = reverse( o.idx );\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype, y.dtype );\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays...\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache references to the input and output ndarray buffers...\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache offset increments for the innermost loop...\n\tdx0 = sx[0];\n\tdy0 = sy[0];\n\n\t// Cache accessors:\n\tget = x.accessors[0];\n\tset = y.accessors[1];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\tS9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\tS9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\toy9 = oy + ( j9*sy[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\tS8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\tS8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( S8*sx[8] );\n\t\t\tdy9 = sy[9] - ( S8*sy[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\toy8 = oy9 + ( j8*sy[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\tS7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\tS7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( S7*sx[7] );\n\t\t\t\tdy8 = sy[8] - ( S7*sy[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\toy7 = oy8 + ( j7*sy[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\tS6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tS6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( S6*sx[6] );\n\t\t\t\t\tdy7 = sy[7] - ( S6*sy[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\toy6 = oy7 + ( j6*sy[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\tS5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tS5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( S5*sx[5] );\n\t\t\t\t\t\tdy6 = sy[6] - ( S5*sy[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\toy5 = oy6 + ( j5*sy[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\tS4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tS4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( S4*sx[4] );\n\t\t\t\t\t\t\tdy5 = sy[5] - ( S4*sy[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\toy4 = oy5 + ( j4*sy[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\tS3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tS3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( S3*sx[3] );\n\t\t\t\t\t\t\t\tdy4 = sy[4] - ( S3*sy[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\toy3 = oy4 + ( j3*sy[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\tS2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tS2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( S2*sx[2] );\n\t\t\t\t\t\t\t\t\tdy3 = sy[3] - ( S2*sy[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\toy2 = oy3 + ( j2*sy[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\tS1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tS1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( S1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tdy2 = sy[2] - ( S1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\toy1 = oy2 + ( j1*sy[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tS0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute index offsets for the first input and output ndarray elements in the current block...\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tiy = oy1 + ( j0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute loop offset increments...\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( S0*sx[0] );\n\t\t\t\t\t\t\t\t\t\t\tdy1 = sy[1] - ( S0*sy[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j9+i9, j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t\tiy += dy9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default blockedmap10d;\n"],"names":["MODE","MAP","x","y","fcn","thisArg","data","offset","call","ref","xbuf","ybuf","dx0","dy0","S0","ix","iy","i0","shape","strides","isRowMajor","dx1","dy1","idx","sh","S1","sx","sy","i1","zeroTo","length","reverse","take","dx2","dy2","S2","i2","dx3","dy3","S3","i3","dx4","dy4","S4","i4","dx5","dy5","S5","i5","dx6","dy6","S6","i6","dx7","dy7","S7","i7","dx8","dy8","S8","i8","dx9","dy9","S9","i9","ACCESSOR_MAP","accessors","get","set","BLOCKED_MAP","bsize","ox1","oy1","s0","s1","ox","oy","j0","j1","o","loopOrder","blockSize","dtype","ox2","oy2","s2","j2","ox3","oy3","j3","ox4","oy4","j4","ox5","oy5","j5","ox6","oy6","j6","ox7","oy7","j7","ox8","oy8","j8","ox9","oy9","j9","BLOCKED_ACCESSOR_MAP","MAX_DIMS","map","arrays","ndims","shx","shy","iox","ioy","len","ord","i","d","ndarray2object","Error","format","accessorProtocol","iterationOrder","strides2order","ordx","ordy","numel","order","vind2bind","ind2sub","accessormapnd","mapnd"],"mappings":";;+hDA6BA,IAAIA,EAAO,QCAX,IAAIA,EAAO,QC2CX,IAAIC,EAAM,CCoBV,SAAgBC,EAAGC,EAAGC,EAAKC,GAC1BF,EAAEG,KAAMH,EAAEI,QAAWH,EAAII,KAAMH,EAASH,EAAEI,KAAMJ,EAAEK,QAAU,GAAIL,EAAEO,IACnE,ECFA,SAAgBP,EAAGC,EAAGC,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AG5C,GAAIyC,GAAG7C,GAAI0C,GAAG9C,GAAI2C,GAAG/C,GAAI4C,GAAGhD,GAAI6C,GAAGjD,GAAI8C,GAAGlD,GAAI0C,GAAGlD,GAAIiD,GAAG5D,IAAMM,GAAOrB,EAAEO,MACrIM,IAAMH,EACNI,IAAMH,EAEPE,IAAMM,EACNL,IAAMM,CACN,CACDP,IAAMkB,EACNjB,IAAMkB,CACN,CACDnB,IAAMsB,EACNrB,IAAMsB,CACN,CACDvB,IAAM0B,EACNzB,IAAM0B,CACN,CACD3B,IAAM8B,EACN7B,IAAM8B,CACN,CACD/B,IAAMkC,EACNjC,IAAMkC,CACN,CACDnC,IAAMsC,EACNrC,IAAMsC,CACN,CACDvC,IAAM0C,EACNzC,IAAM0C,CACN,CAUX,ECvQA,SAAwBxD,EAAGC,EAAGC,EAAKC,GAClC,IAAIiE,EACA5D,EACAC,EACAwD,EACAC,EACAxD,EACAS,EACAY,EACAI,EACAI,EACAI,EACAI,EACAI,EACAI,EACAI,EACAhD,EACAS,EACAY,EACAI,EACAI,EACAI,EACAI,EACAI,EACAI,EACAI,EACAS,EACAY,EACAI,EACAG,EACAG,EACAG,EACAG,EACAG,EACAG,EACAjC,EACAY,EACAI,EACAG,EACAG,EACAG,EACAG,EACAG,EACAG,EACAnF,EACAC,EACAV,EACAW,GACAU,GACAI,GACAI,GACAI,GACAI,GACAI,GACAI,GACAI,GACArC,GACAC,GACAgD,GACAC,GACA7D,GACAC,GACAC,GACAW,GACAQ,GACAI,GACAI,GACAI,GACAI,GACAI,GACAI,GACAI,GACAa,GACAC,GACAQ,GACAG,GACAG,GACAG,GACAG,GACAG,GACAG,GACAG,GACA5B,GA+BJ,IAzBAvD,GADAuD,GAAIC,EAAW9E,EAAEgB,MAAOhB,EAAEiB,QAAShB,EAAEgB,UAC9BK,GACPE,GAAKqD,GAAErD,GACPC,GAAKoD,GAAEpD,GACPJ,EAAMQ,EAASgD,GAAExD,KAGjB+C,EAAQW,EAAW/E,EAAEgF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D,EAAMK,GAAMQ,EAAKrB,EAAEO,KAE5D,CEsGS4H,CAAenI,EAAGC,EAAGC,EAAKC,QDtKnC,SAAgBH,EAAGC,EAAGC,EAAKC,GAC1B,IAAIK,EACAC,EACAoH,EACAC,EACAX,EACA9F,EACAC,EACAE,EACAC,EACAgD,EACAC,EACA7D,EACAC,EACAuG,EAwBJ,IAtBA/F,EAAKtB,EAAEgB,MAGPmG,EAAMY,EAAOzG,GAGbd,EAAOR,EAAEI,KACTK,EAAOR,EAAEG,KAGToB,EAAKxB,EAAEiB,QACPQ,EAAKxB,EAAEgB,QAGPwD,EAAKzE,EAAEK,OACPqE,EAAKzE,EAAEI,OAGPwH,EAAO7H,EAAEgI,MACTF,EAAO7H,EAAE+H,MAGHX,EAAI,EAAGA,EAAIF,EAAKE,IACrBxG,EAAKoH,EAAW3G,EAAIE,EAAIiD,EAAIoD,EAAMR,EAAGvH,GACrCgB,EAAKmH,EAAW3G,EAAIG,EAAIiD,EAAIoD,EAAMT,EAAGvH,GACrCuB,EAAM6G,EAAS5G,EAAIE,EAAI,EAAGqG,EAAMR,EAAGvH,GACnCW,EAAMK,GAAOZ,EAAII,KAAMH,EAASK,EAAMK,GAAMQ,EAAKrB,EAAEO,IAErD,CC4HC6H,CAAOpI,EAAGC,EAAGC,EAAKC,SAtClB,CAuCD"} \ No newline at end of file diff --git a/lib/0d.js b/lib/0d.js deleted file mode 100644 index 6b81f2c..0000000 --- a/lib/0d.js +++ /dev/null @@ -1,100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Applies a callback function to elements in a zero-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ){ -* return z * 10.0; -* } -* -* // Create a data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0 ] ); -* var ybuf = new Float64Array( 1 ); -* -* // Define the shape of the input and output arrays: -* var shape = []; -* -* // Define the array strides: -* var sx = [ 0 ]; -* var sy = [ 0 ]; -* -* // Define the index offset: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* } -* -* // Apply function: -* map0d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0 ] -*/ -function map0d( x, y, fcn, thisArg ) { - y.data[ y.offset ] = fcn.call( thisArg, x.data[ x.offset ], [], x.ref ); -} - - -// EXPORTS // - -module.exports = map0d; diff --git a/lib/0d_accessors.js b/lib/0d_accessors.js deleted file mode 100644 index d5153ac..0000000 --- a/lib/0d_accessors.js +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Applies a callback function to elements in a zero-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -* var ybuf = new Complex64Array( 2 ); -* -* // Define the shape of the input and output arrays: -* var shape = []; -* -* // Define the array strides: -* var sx = [ 0 ]; -* var sy = [ 0 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map0d( x, y, scale, {} ); -* // ybuf => [ 30.0, 40.0, 0.0, 0.0 ] -*/ -function map0d( x, y, fcn, thisArg ) { - y.accessors[ 1 ]( y.data, y.offset, fcn.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ); // eslint-disable-line max-len -} - - -// EXPORTS // - -module.exports = map0d; diff --git a/lib/10d.js b/lib/10d.js deleted file mode 100644 index a733e97..0000000 --- a/lib/10d.js +++ /dev/null @@ -1,281 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map10d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var dy9; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 9 ]; - S1 = sh[ 8 ]; - S2 = sh[ 7 ]; - S3 = sh[ 6 ]; - S4 = sh[ 5 ]; - S5 = sh[ 4 ]; - S6 = sh[ 3 ]; - S7 = sh[ 2 ]; - S8 = sh[ 1 ]; - S9 = sh[ 0 ]; - dx0 = sx[ 9 ]; // offset increment for innermost loop - dx1 = sx[ 8 ] - ( S0*sx[9] ); - dx2 = sx[ 7 ] - ( S1*sx[8] ); - dx3 = sx[ 6 ] - ( S2*sx[7] ); - dx4 = sx[ 5 ] - ( S3*sx[6] ); - dx5 = sx[ 4 ] - ( S4*sx[5] ); - dx6 = sx[ 3 ] - ( S5*sx[4] ); - dx7 = sx[ 2 ] - ( S6*sx[3] ); - dx8 = sx[ 1 ] - ( S7*sx[2] ); - dx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 9 ]; - dy1 = sy[ 8 ] - ( S0*sy[9] ); - dy2 = sy[ 7 ] - ( S1*sy[8] ); - dy3 = sy[ 6 ] - ( S2*sy[7] ); - dy4 = sy[ 5 ] - ( S3*sy[6] ); - dy5 = sy[ 4 ] - ( S4*sy[5] ); - dy6 = sy[ 3 ] - ( S5*sy[4] ); - dy7 = sy[ 2 ] - ( S6*sy[3] ); - dy8 = sy[ 1 ] - ( S7*sy[2] ); - dy9 = sy[ 0 ] - ( S8*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - S9 = sh[ 9 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); - dx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - dy7 = sy[ 7 ] - ( S6*sy[6] ); - dy8 = sy[ 8 ] - ( S7*sy[7] ); - dy9 = sy[ 9 ] - ( S8*sy[8] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } - ix += dx9; - iy += dy9; - } -} - - -// EXPORTS // - -module.exports = map10d; diff --git a/lib/10d_accessors.js b/lib/10d_accessors.js deleted file mode 100644 index 6cfe033..0000000 --- a/lib/10d_accessors.js +++ /dev/null @@ -1,301 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map10d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var dy9; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 9 ]; - S1 = sh[ 8 ]; - S2 = sh[ 7 ]; - S3 = sh[ 6 ]; - S4 = sh[ 5 ]; - S5 = sh[ 4 ]; - S6 = sh[ 3 ]; - S7 = sh[ 2 ]; - S8 = sh[ 1 ]; - S9 = sh[ 0 ]; - dx0 = sx[ 9 ]; // offset increment for innermost loop - dx1 = sx[ 8 ] - ( S0*sx[9] ); - dx2 = sx[ 7 ] - ( S1*sx[8] ); - dx3 = sx[ 6 ] - ( S2*sx[7] ); - dx4 = sx[ 5 ] - ( S3*sx[6] ); - dx5 = sx[ 4 ] - ( S4*sx[5] ); - dx6 = sx[ 3 ] - ( S5*sx[4] ); - dx7 = sx[ 2 ] - ( S6*sx[3] ); - dx8 = sx[ 1 ] - ( S7*sx[2] ); - dx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 9 ]; - dy1 = sy[ 8 ] - ( S0*sy[9] ); - dy2 = sy[ 7 ] - ( S1*sy[8] ); - dy3 = sy[ 6 ] - ( S2*sy[7] ); - dy4 = sy[ 5 ] - ( S3*sy[6] ); - dy5 = sy[ 4 ] - ( S4*sy[5] ); - dy6 = sy[ 3 ] - ( S5*sy[4] ); - dy7 = sy[ 2 ] - ( S6*sy[3] ); - dy8 = sy[ 1 ] - ( S7*sy[2] ); - dy9 = sy[ 0 ] - ( S8*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - S9 = sh[ 9 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); - dx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - dy7 = sy[ 7 ] - ( S6*sy[6] ); - dy8 = sy[ 8 ] - ( S7*sy[7] ); - dy9 = sy[ 9 ] - ( S8*sy[8] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } - ix += dx9; - iy += dy9; - } -} - - -// EXPORTS // - -module.exports = map10d; diff --git a/lib/10d_blocked.js b/lib/10d_blocked.js deleted file mode 100644 index 48c7beb..0000000 --- a/lib/10d_blocked.js +++ /dev/null @@ -1,389 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap10d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var dy9; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var ox9; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var oy7; - var oy8; - var oy9; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var j9; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j9 = sh[9]; j9 > 0; ) { - if ( j9 < bsize ) { - S9 = j9; - j9 = 0; - } else { - S9 = bsize; - j9 -= bsize; - } - ox9 = ox + ( j9*sx[9] ); - oy9 = oy + ( j9*sy[9] ); - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - S8 = j8; - j8 = 0; - } else { - S8 = bsize; - j8 -= bsize; - } - dx9 = sx[9] - ( S8*sx[8] ); - dy9 = sy[9] - ( S8*sy[8] ); - ox8 = ox9 + ( j8*sx[8] ); - oy8 = oy9 + ( j8*sy[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - S7 = j7; - j7 = 0; - } else { - S7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( S7*sx[7] ); - dy8 = sy[8] - ( S7*sy[7] ); - ox7 = ox8 + ( j7*sx[7] ); - oy7 = oy8 + ( j7*sy[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( S6*sx[6] ); - dy7 = sy[7] - ( S6*sy[6] ); - ox6 = ox7 + ( j6*sx[6] ); - oy6 = oy7 + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j9+i9, j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } - ix += dx9; - iy += dy9; - } - } - } - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap10d; diff --git a/lib/10d_blocked_accessors.js b/lib/10d_blocked_accessors.js deleted file mode 100644 index c9a6236..0000000 --- a/lib/10d_blocked_accessors.js +++ /dev/null @@ -1,409 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a ten-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap10d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var dy9; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var ox9; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var oy7; - var oy8; - var oy9; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var j9; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j9 = sh[9]; j9 > 0; ) { - if ( j9 < bsize ) { - S9 = j9; - j9 = 0; - } else { - S9 = bsize; - j9 -= bsize; - } - ox9 = ox + ( j9*sx[9] ); - oy9 = oy + ( j9*sy[9] ); - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - S8 = j8; - j8 = 0; - } else { - S8 = bsize; - j8 -= bsize; - } - dx9 = sx[9] - ( S8*sx[8] ); - dy9 = sy[9] - ( S8*sy[8] ); - ox8 = ox9 + ( j8*sx[8] ); - oy8 = oy9 + ( j8*sy[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - S7 = j7; - j7 = 0; - } else { - S7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( S7*sx[7] ); - dy8 = sy[8] - ( S7*sy[7] ); - ox7 = ox8 + ( j7*sx[7] ); - oy7 = oy8 + ( j7*sy[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( S6*sx[6] ); - dy7 = sy[7] - ( S6*sy[6] ); - ox6 = ox7 + ( j6*sx[6] ); - oy6 = oy7 + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j9+i9, j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } - ix += dx9; - iy += dy9; - } - } - } - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap10d; diff --git a/lib/1d.js b/lib/1d.js deleted file mode 100644 index b8e6a3a..0000000 --- a/lib/1d.js +++ /dev/null @@ -1,129 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Applies a callback function to elements in a one-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Float64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 4 ]; -* -* // Define the array strides: -* var sx = [ 2 ]; -* var sy = [ 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map1d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 40.0, 60.0, 80.0 ] -*/ -function map1d( x, y, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dy0; - var S0; - var ix; - var iy; - var i0; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables: dimensions and loop offset (pointer) increments... - S0 = x.shape[ 0 ]; - dx0 = x.strides[ 0 ]; - dy0 = y.strides[ 0 ]; - - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], [ i0 ], x.ref ); - ix += dx0; - iy += dy0; - } -} - - -// EXPORTS // - -module.exports = map1d; diff --git a/lib/1d_accessors.js b/lib/1d_accessors.js deleted file mode 100644 index 2031166..0000000 --- a/lib/1d_accessors.js +++ /dev/null @@ -1,149 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Applies a callback function to elements in a one-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 4 ]; -* -* // Define the array strides: -* var sx = [ 1 ]; -* var sy = [ 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map1d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map1d( x, y, fcn, thisArg ) { - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dy0; - var S0; - var ix; - var iy; - var i0; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables: dimensions and loop offset (pointer) increments... - S0 = x.shape[ 0 ]; - dx0 = x.strides[ 0 ]; - dy0 = y.strides[ 0 ]; - - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), [ i0 ], x.ref ) ); - ix += dx0; - iy += dy0; - } -} - - -// EXPORTS // - -module.exports = map1d; diff --git a/lib/2d.js b/lib/2d.js deleted file mode 100644 index af8e0ab..0000000 --- a/lib/2d.js +++ /dev/null @@ -1,167 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Float64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* var sy = [ 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map2d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0 ] -*/ -function map2d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dx1; - var dy0; - var dy1; - var idx; - var sh; - var S0; - var S1; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 1 ]; - S1 = sh[ 0 ]; - dx0 = sx[ 1 ]; // offset increment for the outermost loop - dx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for innermost loop - dy0 = sy[ 1 ]; - dy1 = sy[ 0 ] - ( S0*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - dx0 = sx[ 0 ]; // offset increment for outermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for innermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sx[0] ); - idx = reverse( idx ); - } - // Set the pointer to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache the references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } -} - - -// EXPORTS // - -module.exports = map2d; diff --git a/lib/2d_accessors.js b/lib/2d_accessors.js deleted file mode 100644 index e13d252..0000000 --- a/lib/2d_accessors.js +++ /dev/null @@ -1,187 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 2, 1 ]; -* var sy = [ 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map2d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map2d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dy0; - var dy1; - var idx; - var sh; - var S0; - var S1; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 1 ]; - S1 = sh[ 0 ]; - dx0 = sx[ 1 ]; // offset increment for the outermost loop - dx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for innermost loop - dy0 = sy[ 1 ]; - dy1 = sy[ 0 ] - ( S0*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - dx0 = sx[ 0 ]; // offset increment for outermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for innermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sx[0] ); - idx = reverse( idx ); - } - // Set the pointer to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache the references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } -} - - -// EXPORTS // - -module.exports = map2d; diff --git a/lib/2d_blocked.js b/lib/2d_blocked.js deleted file mode 100644 index 5002244..0000000 --- a/lib/2d_blocked.js +++ /dev/null @@ -1,195 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Float64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* var sy = [ 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap2d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0 ] -*/ -function blockedmap2d( x, y, fcn, thisArg ) { - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dy0; - var dy1; - var ox1; - var oy1; - var idx; - var sh; - var s0; - var s1; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var j0; - var j1; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache the references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - ox1 = ox + ( j1*sx[1] ); - oy1 = oy + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + (j0*sx[0]); - iy = oy1 + (j0*sy[0]); - - // Compute the loop offset increments... - dx1 = sx[1] - (s0*sx[0]); - dy1 = sy[1] - (s0*sy[0]); - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap2d; diff --git a/lib/2d_blocked_accessors.js b/lib/2d_blocked_accessors.js deleted file mode 100644 index e5443f4..0000000 --- a/lib/2d_blocked_accessors.js +++ /dev/null @@ -1,215 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a two-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 2, 1 ]; -* var sy = [ 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap2d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap2d( x, y, fcn, thisArg ) { - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dy0; - var dy1; - var ox1; - var oy1; - var idx; - var get; - var set; - var sh; - var s0; - var s1; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var j0; - var j1; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache the references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - ox1 = ox + ( j1*sx[1] ); - oy1 = oy + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + (j0*sx[0]); - iy = oy1 + (j0*sy[0]); - - // Compute the loop offset increments... - dx1 = sx[1] - (s0*sx[0]); - dy1 = sy[1] - (s0*sy[0]); - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap2d; diff --git a/lib/3d.js b/lib/3d.js deleted file mode 100644 index f75e00c..0000000 --- a/lib/3d.js +++ /dev/null @@ -1,181 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* var sy = [ 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map3d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map3d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dy0; - var dy1; - var dy2; - var idx; - var sh; - var S0; - var S1; - var S2; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 2 ]; - S1 = sh[ 1 ]; - S2 = sh[ 0 ]; - dx0 = sx[ 2 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[2] ); - dx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 2 ]; - dy1 = sy[ 1 ] - ( S0*sy[2] ); - dy2 = sy[ 0 ] - ( S1*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } -} - - -// EXPORTS // - -module.exports = map3d; diff --git a/lib/3d_accessors.js b/lib/3d_accessors.js deleted file mode 100644 index 67df6d9..0000000 --- a/lib/3d_accessors.js +++ /dev/null @@ -1,201 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 2, 1 ]; -* var sy = [ 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map3d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map3d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dy0; - var dy1; - var dy2; - var idx; - var get; - var set; - var sh; - var S0; - var S1; - var S2; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 2 ]; - S1 = sh[ 1 ]; - S2 = sh[ 0 ]; - dx0 = sx[ 2 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[2] ); - dx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 2 ]; - dy1 = sy[ 1 ] - ( S0*sy[2] ); - dy2 = sy[ 0 ] - ( S1*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } -} - - -// EXPORTS // - -module.exports = map3d; diff --git a/lib/3d_blocked.js b/lib/3d_blocked.js deleted file mode 100644 index d11a800..0000000 --- a/lib/3d_blocked.js +++ /dev/null @@ -1,221 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( x ) { -* return x * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* var sy = [ 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap3d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap3d( x, y, fcn, thisArg ) { - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dy0; - var dy1; - var dy2; - var ox1; - var ox2; - var oy1; - var oy2; - var idx; - var sh; - var s0; - var s1; - var s2; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var j0; - var j1; - var j2; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - ox2 = ox + ( j2*sx[2] ); - oy2 = oy + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - dy2 = sy[2] - ( s1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( s0*sx[0] ); - dy1 = sy[1] - ( s0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap3d; diff --git a/lib/3d_blocked_accessors.js b/lib/3d_blocked_accessors.js deleted file mode 100644 index e8efa04..0000000 --- a/lib/3d_blocked_accessors.js +++ /dev/null @@ -1,241 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a three-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 2, 2, 1 ]; -* var sy = [ 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap3d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap3d( x, y, fcn, thisArg ) { - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dy0; - var dy1; - var dy2; - var ox1; - var ox2; - var oy1; - var oy2; - var idx; - var get; - var set; - var sh; - var s0; - var s1; - var s2; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var j0; - var j1; - var j2; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - ox2 = ox + ( j2*sx[2] ); - oy2 = oy + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - dy2 = sy[2] - ( s1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( s0*sx[0] ); - dy1 = sy[1] - ( s0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap3d; diff --git a/lib/4d.js b/lib/4d.js deleted file mode 100644 index f98a3e1..0000000 --- a/lib/4d.js +++ /dev/null @@ -1,195 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 4, 4, 1 ]; -* var sy = [ 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map4d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map4d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dy0; - var dy1; - var dy2; - var dy3; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 3 ]; - S1 = sh[ 2 ]; - S2 = sh[ 1 ]; - S3 = sh[ 0 ]; - dx0 = sx[ 3 ]; // offset increment for innermost loop - dx1 = sx[ 2 ] - ( S0*sx[3] ); - dx2 = sx[ 1 ] - ( S1*sx[2] ); - dx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 3 ]; - dy1 = sy[ 2 ] - ( S0*sy[3] ); - dy2 = sy[ 1 ] - ( S1*sy[2] ); - dy3 = sy[ 0 ] - ( S2*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } -} - - -// EXPORTS // - -module.exports = map4d; diff --git a/lib/4d_accessors.js b/lib/4d_accessors.js deleted file mode 100644 index 0084092..0000000 --- a/lib/4d_accessors.js +++ /dev/null @@ -1,215 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map4d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map4d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dy0; - var dy1; - var dy2; - var dy3; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 3 ]; - S1 = sh[ 2 ]; - S2 = sh[ 1 ]; - S3 = sh[ 0 ]; - dx0 = sx[ 3 ]; // offset increment for innermost loop - dx1 = sx[ 2 ] - ( S0*sx[3] ); - dx2 = sx[ 1 ] - ( S1*sx[2] ); - dx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 3 ]; - dy1 = sy[ 2 ] - ( S0*sy[3] ); - dy2 = sy[ 1 ] - ( S1*sy[2] ); - dy3 = sy[ 0 ] - ( S2*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } -} - - -// EXPORTS // - -module.exports = map4d; diff --git a/lib/4d_blocked.js b/lib/4d_blocked.js deleted file mode 100644 index 492f0e6..0000000 --- a/lib/4d_blocked.js +++ /dev/null @@ -1,245 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( x ) { -* return x * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 4, 4, 1 ]; -* var sy = [ 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap4d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dy0; - var dy1; - var dy2; - var dy3; - var ox1; - var ox2; - var ox3; - var idx; - var oy1; - var oy2; - var oy3; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var j0; - var j1; - var j2; - var j3; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - ox3 = ox + ( j3*sx[3] ); - oy3 = oy + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap4d; diff --git a/lib/4d_blocked_accessors.js b/lib/4d_blocked_accessors.js deleted file mode 100644 index ce50ff5..0000000 --- a/lib/4d_blocked_accessors.js +++ /dev/null @@ -1,265 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a four-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap4d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dy0; - var dy1; - var dy2; - var dy3; - var ox1; - var ox2; - var ox3; - var idx; - var oy1; - var oy2; - var oy3; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var j0; - var j1; - var j2; - var j3; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - ox3 = ox + ( j3*sx[3] ); - oy3 = oy + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap4d; diff --git a/lib/5d.js b/lib/5d.js deleted file mode 100644 index 0ed7273..0000000 --- a/lib/5d.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map5d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map5d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 4 ]; - S1 = sh[ 3 ]; - S2 = sh[ 2 ]; - S3 = sh[ 1 ]; - S4 = sh[ 0 ]; - dx0 = sx[ 4 ]; // offset increment for innermost loop - dx1 = sx[ 3 ] - ( S0*sx[4] ); - dx2 = sx[ 2 ] - ( S1*sx[3] ); - dx3 = sx[ 1 ] - ( S2*sx[2] ); - dx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 4 ]; - dy1 = sy[ 3 ] - ( S0*sy[4] ); - dy2 = sy[ 2 ] - ( S1*sy[3] ); - dy3 = sy[ 1 ] - ( S2*sy[2] ); - dy4 = sy[ 0 ] - ( S3*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } -} - - -// EXPORTS // - -module.exports = map5d; diff --git a/lib/5d_accessors.js b/lib/5d_accessors.js deleted file mode 100644 index 408a680..0000000 --- a/lib/5d_accessors.js +++ /dev/null @@ -1,229 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map5d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map5d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 4 ]; - S1 = sh[ 3 ]; - S2 = sh[ 2 ]; - S3 = sh[ 1 ]; - S4 = sh[ 0 ]; - dx0 = sx[ 4 ]; // offset increment for innermost loop - dx1 = sx[ 3 ] - ( S0*sx[4] ); - dx2 = sx[ 2 ] - ( S1*sx[3] ); - dx3 = sx[ 1 ] - ( S2*sx[2] ); - dx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 4 ]; - dy1 = sy[ 3 ] - ( S0*sy[4] ); - dy2 = sy[ 2 ] - ( S1*sy[3] ); - dy3 = sy[ 1 ] - ( S2*sy[2] ); - dy4 = sy[ 0 ] - ( S3*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } -} - - -// EXPORTS // - -module.exports = map5d; diff --git a/lib/5d_blocked.js b/lib/5d_blocked.js deleted file mode 100644 index d8b00a0..0000000 --- a/lib/5d_blocked.js +++ /dev/null @@ -1,269 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap5d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var ox1; - var ox2; - var ox3; - var ox4; - var idx; - var oy1; - var oy2; - var oy3; - var oy4; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var j0; - var j1; - var j2; - var j3; - var j4; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - ox4 = ox + ( j4*sx[4] ); - oy4 = oy + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap5d; diff --git a/lib/5d_blocked_accessors.js b/lib/5d_blocked_accessors.js deleted file mode 100644 index 04d6b1f..0000000 --- a/lib/5d_blocked_accessors.js +++ /dev/null @@ -1,289 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a five-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap5d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var ox1; - var ox2; - var ox3; - var ox4; - var idx; - var oy1; - var oy2; - var oy3; - var oy4; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var j0; - var j1; - var j2; - var j3; - var j4; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - ox4 = ox + ( j4*sx[4] ); - oy4 = oy + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap5d; diff --git a/lib/6d.js b/lib/6d.js deleted file mode 100644 index f5903c3..0000000 --- a/lib/6d.js +++ /dev/null @@ -1,225 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map6d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map6d( x, y, isRowMajor, fcn, thisArg ) { - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 5 ]; - S1 = sh[ 4 ]; - S2 = sh[ 3 ]; - S3 = sh[ 2 ]; - S4 = sh[ 1 ]; - S5 = sh[ 0 ]; - dx0 = sx[ 5 ]; // offset increment for innermost loop - dx1 = sx[ 4 ] - ( S0*sx[5] ); - dx2 = sx[ 3 ] - ( S1*sx[4] ); - dx3 = sx[ 2 ] - ( S2*sx[3] ); - dx4 = sx[ 1 ] - ( S3*sx[2] ); - dx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 5 ]; - dy1 = sy[ 4 ] - ( S0*sy[5] ); - dy2 = sy[ 3 ] - ( S1*sy[4] ); - dy3 = sy[ 2 ] - ( S2*sy[3] ); - dy4 = sy[ 1 ] - ( S3*sy[2] ); - dy5 = sy[ 0 ] - ( S4*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } -} - - -// EXPORTS // - -module.exports = map6d; diff --git a/lib/6d_accessors.js b/lib/6d_accessors.js deleted file mode 100644 index c090847..0000000 --- a/lib/6d_accessors.js +++ /dev/null @@ -1,245 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map6d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map6d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 5 ]; - S1 = sh[ 4 ]; - S2 = sh[ 3 ]; - S3 = sh[ 2 ]; - S4 = sh[ 1 ]; - S5 = sh[ 0 ]; - dx0 = sx[ 5 ]; // offset increment for innermost loop - dx1 = sx[ 4 ] - ( S0*sx[5] ); - dx2 = sx[ 3 ] - ( S1*sx[4] ); - dx3 = sx[ 2 ] - ( S2*sx[3] ); - dx4 = sx[ 1 ] - ( S3*sx[2] ); - dx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 5 ]; - dy1 = sy[ 4 ] - ( S0*sy[5] ); - dy2 = sy[ 3 ] - ( S1*sy[4] ); - dy3 = sy[ 2 ] - ( S2*sy[3] ); - dy4 = sy[ 1 ] - ( S3*sy[2] ); - dy5 = sy[ 0 ] - ( S4*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } -} - - -// EXPORTS // - -module.exports = map6d; diff --git a/lib/6d_blocked.js b/lib/6d_blocked.js deleted file mode 100644 index 94006ac..0000000 --- a/lib/6d_blocked.js +++ /dev/null @@ -1,293 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap6d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - ox5 = ox + ( j5*sx[5] ); - oy5 = oy + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap6d; diff --git a/lib/6d_blocked_accessors.js b/lib/6d_blocked_accessors.js deleted file mode 100644 index e8734d2..0000000 --- a/lib/6d_blocked_accessors.js +++ /dev/null @@ -1,313 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a six-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap6d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var set; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - ox5 = ox + ( j5*sx[5] ); - oy5 = oy + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap6d; diff --git a/lib/7d.js b/lib/7d.js deleted file mode 100644 index 9ca1bb5..0000000 --- a/lib/7d.js +++ /dev/null @@ -1,239 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map7d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 6 ]; - S1 = sh[ 5 ]; - S2 = sh[ 4 ]; - S3 = sh[ 3 ]; - S4 = sh[ 2 ]; - S5 = sh[ 1 ]; - S6 = sh[ 0 ]; - dx0 = sx[ 6 ]; // offset increment for innermost loop - dx1 = sx[ 5 ] - ( S0*sx[6] ); - dx2 = sx[ 4 ] - ( S1*sx[5] ); - dx3 = sx[ 3 ] - ( S2*sx[4] ); - dx4 = sx[ 2 ] - ( S3*sx[3] ); - dx5 = sx[ 1 ] - ( S4*sx[2] ); - dx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 6 ]; - dy1 = sy[ 5 ] - ( S0*sy[6] ); - dy2 = sy[ 4 ] - ( S1*sy[5] ); - dy3 = sy[ 3 ] - ( S2*sy[4] ); - dy4 = sy[ 2 ] - ( S3*sy[3] ); - dy5 = sy[ 1 ] - ( S4*sy[2] ); - dy6 = sy[ 0 ] - ( S5*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } -} - - -// EXPORTS // - -module.exports = map7d; diff --git a/lib/7d_accessors.js b/lib/7d_accessors.js deleted file mode 100644 index c035581..0000000 --- a/lib/7d_accessors.js +++ /dev/null @@ -1,259 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map7d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 6 ]; - S1 = sh[ 5 ]; - S2 = sh[ 4 ]; - S3 = sh[ 3 ]; - S4 = sh[ 2 ]; - S5 = sh[ 1 ]; - S6 = sh[ 0 ]; - dx0 = sx[ 6 ]; // offset increment for innermost loop - dx1 = sx[ 5 ] - ( S0*sx[6] ); - dx2 = sx[ 4 ] - ( S1*sx[5] ); - dx3 = sx[ 3 ] - ( S2*sx[4] ); - dx4 = sx[ 2 ] - ( S3*sx[3] ); - dx5 = sx[ 1 ] - ( S4*sx[2] ); - dx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 6 ]; - dy1 = sy[ 5 ] - ( S0*sy[6] ); - dy2 = sy[ 4 ] - ( S1*sy[5] ); - dy3 = sy[ 3 ] - ( S2*sy[4] ); - dy4 = sy[ 2 ] - ( S3*sy[3] ); - dy5 = sy[ 1 ] - ( S4*sy[2] ); - dy6 = sy[ 0 ] - ( S5*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } -} - - -// EXPORTS // - -module.exports = map7d; diff --git a/lib/7d_blocked.js b/lib/7d_blocked.js deleted file mode 100644 index b874d77..0000000 --- a/lib/7d_blocked.js +++ /dev/null @@ -1,317 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap7d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - ox6 = ox + ( j6*sx[6] ); - oy6 = oy + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap7d; diff --git a/lib/7d_blocked_accessors.js b/lib/7d_blocked_accessors.js deleted file mode 100644 index b7a5c35..0000000 --- a/lib/7d_blocked_accessors.js +++ /dev/null @@ -1,337 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a seven-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap7d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - ox6 = ox + ( j6*sx[6] ); - oy6 = oy + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap7d; diff --git a/lib/8d.js b/lib/8d.js deleted file mode 100644 index 8eae97e..0000000 --- a/lib/8d.js +++ /dev/null @@ -1,253 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map8d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 7 ]; - S1 = sh[ 6 ]; - S2 = sh[ 5 ]; - S3 = sh[ 4 ]; - S4 = sh[ 3 ]; - S5 = sh[ 2 ]; - S6 = sh[ 1 ]; - S7 = sh[ 0 ]; - dx0 = sx[ 7 ]; // offset increment for innermost loop - dx1 = sx[ 6 ] - ( S0*sx[7] ); - dx2 = sx[ 5 ] - ( S1*sx[6] ); - dx3 = sx[ 4 ] - ( S2*sx[5] ); - dx4 = sx[ 3 ] - ( S3*sx[4] ); - dx5 = sx[ 2 ] - ( S4*sx[3] ); - dx6 = sx[ 1 ] - ( S5*sx[2] ); - dx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 7 ]; - dy1 = sy[ 6 ] - ( S0*sy[7] ); - dy2 = sy[ 5 ] - ( S1*sy[6] ); - dy3 = sy[ 4 ] - ( S2*sy[5] ); - dy4 = sy[ 3 ] - ( S3*sy[4] ); - dy5 = sy[ 2 ] - ( S4*sy[3] ); - dy6 = sy[ 1 ] - ( S5*sy[2] ); - dy7 = sy[ 0 ] - ( S6*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - dy7 = sy[ 7 ] - ( S6*sy[6] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } -} - - -// EXPORTS // - -module.exports = map8d; diff --git a/lib/8d_accessors.js b/lib/8d_accessors.js deleted file mode 100644 index 5323c0f..0000000 --- a/lib/8d_accessors.js +++ /dev/null @@ -1,273 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map8d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 7 ]; - S1 = sh[ 6 ]; - S2 = sh[ 5 ]; - S3 = sh[ 4 ]; - S4 = sh[ 3 ]; - S5 = sh[ 2 ]; - S6 = sh[ 1 ]; - S7 = sh[ 0 ]; - dx0 = sx[ 7 ]; // offset increment for innermost loop - dx1 = sx[ 6 ] - ( S0*sx[7] ); - dx2 = sx[ 5 ] - ( S1*sx[6] ); - dx3 = sx[ 4 ] - ( S2*sx[5] ); - dx4 = sx[ 3 ] - ( S3*sx[4] ); - dx5 = sx[ 2 ] - ( S4*sx[3] ); - dx6 = sx[ 1 ] - ( S5*sx[2] ); - dx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 7 ]; - dy1 = sy[ 6 ] - ( S0*sy[7] ); - dy2 = sy[ 5 ] - ( S1*sy[6] ); - dy3 = sy[ 4 ] - ( S2*sy[5] ); - dy4 = sy[ 3 ] - ( S3*sy[4] ); - dy5 = sy[ 2 ] - ( S4*sy[3] ); - dy6 = sy[ 1 ] - ( S5*sy[2] ); - dy7 = sy[ 0 ] - ( S6*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - dy7 = sy[ 7 ] - ( S6*sy[6] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } -} - - -// EXPORTS // - -module.exports = map8d; diff --git a/lib/8d_blocked.js b/lib/8d_blocked.js deleted file mode 100644 index 2cd8ff5..0000000 --- a/lib/8d_blocked.js +++ /dev/null @@ -1,341 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap8d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var oy7; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - S7 = j7; - j7 = 0; - } else { - S7 = bsize; - j7 -= bsize; - } - ox7 = ox + ( j7*sx[7] ); - oy7 = oy + ( j7*sy[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( S6*sx[6] ); - dy7 = sy[7] - ( S6*sy[6] ); - ox6 = ox7 + ( j6*sx[6] ); - oy6 = oy7 + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap8d; diff --git a/lib/8d_blocked_accessors.js b/lib/8d_blocked_accessors.js deleted file mode 100644 index 32b9979..0000000 --- a/lib/8d_blocked_accessors.js +++ /dev/null @@ -1,361 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in an eight-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap8d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var oy7; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - S7 = j7; - j7 = 0; - } else { - S7 = bsize; - j7 -= bsize; - } - ox7 = ox + ( j7*sx[7] ); - oy7 = oy + ( j7*sy[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( S6*sx[6] ); - dy7 = sy[7] - ( S6*sy[6] ); - ox6 = ox7 + ( j6*sx[6] ); - oy6 = oy7 + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap8d; diff --git a/lib/9d.js b/lib/9d.js deleted file mode 100644 index cb00a0d..0000000 --- a/lib/9d.js +++ /dev/null @@ -1,267 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map9d( x, y, true, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 8 ]; - S1 = sh[ 7 ]; - S2 = sh[ 6 ]; - S3 = sh[ 5 ]; - S4 = sh[ 4 ]; - S5 = sh[ 3 ]; - S6 = sh[ 2 ]; - S7 = sh[ 1 ]; - S8 = sh[ 0 ]; - dx0 = sx[ 8 ]; // offset increment for innermost loop - dx1 = sx[ 7 ] - ( S0*sx[8] ); - dx2 = sx[ 6 ] - ( S1*sx[7] ); - dx3 = sx[ 5 ] - ( S2*sx[6] ); - dx4 = sx[ 4 ] - ( S3*sx[5] ); - dx5 = sx[ 3 ] - ( S4*sx[4] ); - dx6 = sx[ 2 ] - ( S5*sx[3] ); - dx7 = sx[ 1 ] - ( S6*sx[2] ); - dx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 8 ]; - dy1 = sy[ 7 ] - ( S0*sy[8] ); - dy2 = sy[ 6 ] - ( S1*sy[7] ); - dy3 = sy[ 5 ] - ( S2*sy[6] ); - dy4 = sy[ 4 ] - ( S3*sy[5] ); - dy5 = sy[ 3 ] - ( S4*sy[4] ); - dy6 = sy[ 2 ] - ( S5*sy[3] ); - dy7 = sy[ 1 ] - ( S6*sy[2] ); - dy8 = sy[ 0 ] - ( S7*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - dy7 = sy[ 7 ] - ( S6*sy[6] ); - dy8 = sy[ 8 ] - ( S7*sy[7] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } -} - - -// EXPORTS // - -module.exports = map9d; diff --git a/lib/9d_accessors.js b/lib/9d_accessors.js deleted file mode 100644 index 346fce3..0000000 --- a/lib/9d_accessors.js +++ /dev/null @@ -1,287 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* map9d( x, y, true, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var sy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - sy = y.strides; - idx = zeroTo( sh.length ); - if ( isRowMajor ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 8 ]; - S1 = sh[ 7 ]; - S2 = sh[ 6 ]; - S3 = sh[ 5 ]; - S4 = sh[ 4 ]; - S5 = sh[ 3 ]; - S6 = sh[ 2 ]; - S7 = sh[ 1 ]; - S8 = sh[ 0 ]; - dx0 = sx[ 8 ]; // offset increment for innermost loop - dx1 = sx[ 7 ] - ( S0*sx[8] ); - dx2 = sx[ 6 ] - ( S1*sx[7] ); - dx3 = sx[ 5 ] - ( S2*sx[6] ); - dx4 = sx[ 4 ] - ( S3*sx[5] ); - dx5 = sx[ 3 ] - ( S4*sx[4] ); - dx6 = sx[ 2 ] - ( S5*sx[3] ); - dx7 = sx[ 1 ] - ( S6*sx[2] ); - dx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop - dy0 = sy[ 8 ]; - dy1 = sy[ 7 ] - ( S0*sy[8] ); - dy2 = sy[ 6 ] - ( S1*sy[7] ); - dy3 = sy[ 5 ] - ( S2*sy[6] ); - dy4 = sy[ 4 ] - ( S3*sy[5] ); - dy5 = sy[ 3 ] - ( S4*sy[4] ); - dy6 = sy[ 2 ] - ( S5*sy[3] ); - dy7 = sy[ 1 ] - ( S6*sy[2] ); - dy8 = sy[ 0 ] - ( S7*sy[1] ); - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop - dy0 = sy[ 0 ]; - dy1 = sy[ 1 ] - ( S0*sy[0] ); - dy2 = sy[ 2 ] - ( S1*sy[1] ); - dy3 = sy[ 3 ] - ( S2*sy[2] ); - dy4 = sy[ 4 ] - ( S3*sy[3] ); - dy5 = sy[ 5 ] - ( S4*sy[4] ); - dy6 = sy[ 6 ] - ( S5*sy[5] ); - dy7 = sy[ 7 ] - ( S6*sy[6] ); - dy8 = sy[ 8 ] - ( S7*sy[7] ); - idx = reverse( idx ); - } - // Set the pointers to the first indexed elements in the respective ndarrays... - ix = x.offset; - iy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ); // eslint-disable-line max-len - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } -} - - -// EXPORTS // - -module.exports = map9d; diff --git a/lib/9d_blocked.js b/lib/9d_blocked.js deleted file mode 100644 index 4ac3776..0000000 --- a/lib/9d_blocked.js +++ /dev/null @@ -1,365 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* var sy = [ 6, 6, 6, 6, 6, 6, 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* blockedmap9d( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var ybuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var oy7; - var oy8; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Iterate over blocks... - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - S8 = j8; - j8 = 0; - } else { - S8 = bsize; - j8 -= bsize; - } - ox8 = ox + ( j8*sx[8] ); - oy8 = oy + ( j8*sy[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - S7 = j7; - j7 = 0; - } else { - S7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( S7*sx[7] ); - dy8 = sy[8] - ( S7*sy[7] ); - ox7 = ox8 + ( j7*sx[7] ); - oy7 = oy8 + ( j7*sy[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( S6*sx[6] ); - dy7 = sy[7] - ( S6*sy[6] ); - ox6 = ox7 + ( j6*sx[6] ); - oy6 = oy7 + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } - } - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap9d; diff --git a/lib/9d_blocked_accessors.js b/lib/9d_blocked_accessors.js deleted file mode 100644 index 9d5a17c..0000000 --- a/lib/9d_blocked_accessors.js +++ /dev/null @@ -1,385 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-unary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Applies a callback function to elements in a nine-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* var sy = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* blockedmap9d( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var ybuf; - var get; - var set; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dy0; - var dy1; - var dy2; - var dy3; - var dy4; - var dy5; - var dy6; - var dy7; - var dy8; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var oy1; - var oy2; - var oy3; - var oy4; - var oy5; - var oy6; - var oy7; - var oy8; - var idx; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides, y.strides ); - sh = o.sh; - sx = o.sx; - sy = o.sy; - idx = reverse( o.idx ); - - // Determine the block size: - bsize = blockSize( x.dtype, y.dtype ); - - // Cache the indices of the first indexed elements in the respective ndarrays... - ox = x.offset; - oy = y.offset; - - // Cache references to the input and output ndarray buffers... - xbuf = x.data; - ybuf = y.data; - - // Cache offset increments for the innermost loop... - dx0 = sx[0]; - dy0 = sy[0]; - - // Cache accessors: - get = x.accessors[0]; - set = y.accessors[1]; - - // Iterate over blocks... - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - S8 = j8; - j8 = 0; - } else { - S8 = bsize; - j8 -= bsize; - } - ox8 = ox + ( j8*sx[8] ); - oy8 = oy + ( j8*sy[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - S7 = j7; - j7 = 0; - } else { - S7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( S7*sx[7] ); - dy8 = sy[8] - ( S7*sy[7] ); - ox7 = ox8 + ( j7*sx[7] ); - oy7 = oy8 + ( j7*sy[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - S6 = j6; - j6 = 0; - } else { - S6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( S6*sx[6] ); - dy7 = sy[7] - ( S6*sy[6] ); - ox6 = ox7 + ( j6*sx[6] ); - oy6 = oy7 + ( j6*sy[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - S5 = j5; - j5 = 0; - } else { - S5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( S5*sx[5] ); - dy6 = sy[6] - ( S5*sy[5] ); - ox5 = ox6 + ( j5*sx[5] ); - oy5 = oy6 + ( j5*sy[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - S4 = j4; - j4 = 0; - } else { - S4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( S4*sx[4] ); - dy5 = sy[5] - ( S4*sy[4] ); - ox4 = ox5 + ( j4*sx[4] ); - oy4 = oy5 + ( j4*sy[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - S3 = j3; - j3 = 0; - } else { - S3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( S3*sx[3] ); - dy4 = sy[4] - ( S3*sy[3] ); - ox3 = ox4 + ( j3*sx[3] ); - oy3 = oy4 + ( j3*sy[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - S2 = j2; - j2 = 0; - } else { - S2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( S2*sx[2] ); - dy3 = sy[3] - ( S2*sy[2] ); - ox2 = ox3 + ( j2*sx[2] ); - oy2 = oy3 + ( j2*sy[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - S1 = j1; - j1 = 0; - } else { - S1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( S1*sx[1] ); - dy2 = sy[2] - ( S1*sy[1] ); - ox1 = ox2 + ( j1*sx[1] ); - oy1 = oy2 + ( j1*sy[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - S0 = j0; - j0 = 0; - } else { - S0 = bsize; - j0 -= bsize; - } - // Compute index offsets for the first input and output ndarray elements in the current block... - ix = ox1 + ( j0*sx[0] ); - iy = oy1 + ( j0*sy[0] ); - - // Compute loop offset increments... - dx1 = sx[1] - ( S0*sx[0] ); - dy1 = sy[1] - ( S0*sy[0] ); - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ); - ix += dx0; - iy += dy0; - } - ix += dx1; - iy += dy1; - } - ix += dx2; - iy += dy2; - } - ix += dx3; - iy += dy3; - } - ix += dx4; - iy += dy4; - } - ix += dx5; - iy += dy5; - } - ix += dx6; - iy += dy6; - } - ix += dx7; - iy += dy7; - } - ix += dx8; - iy += dy8; - } - } - } - } - } - } - } - } - } - } -} - - -// EXPORTS // - -module.exports = blockedmap9d; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index bf33cef..0000000 --- a/lib/index.js +++ /dev/null @@ -1,81 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Apply a callback function to elements in an input ndarray and assign results to elements in an output ndarray. -* -* @module @stdlib/ndarray-base-map -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* var map = require( '@stdlib/ndarray-base-map' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* var sy = [ 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map( [ x, y ], scale ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index a153c2b..0000000 --- a/lib/main.js +++ /dev/null @@ -1,279 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var iterationOrder = require( '@stdlib/ndarray-base-iteration-order' ); -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var ndarray2object = require( '@stdlib/ndarray-base-ndarraylike2object' ); -var format = require( '@stdlib/string-format' ); -var blockedaccessormap2d = require( './2d_blocked_accessors.js' ); -var blockedaccessormap3d = require( './3d_blocked_accessors.js' ); -var blockedaccessormap4d = require( './4d_blocked_accessors.js' ); -var blockedaccessormap5d = require( './5d_blocked_accessors.js' ); -var blockedaccessormap6d = require( './6d_blocked_accessors.js' ); -var blockedaccessormap7d = require( './7d_blocked_accessors.js' ); -var blockedaccessormap8d = require( './8d_blocked_accessors.js' ); -var blockedaccessormap9d = require( './9d_blocked_accessors.js' ); -var blockedaccessormap10d = require( './10d_blocked_accessors.js' ); -var blockedmap2d = require( './2d_blocked.js' ); -var blockedmap3d = require( './3d_blocked.js' ); -var blockedmap4d = require( './4d_blocked.js' ); -var blockedmap5d = require( './5d_blocked.js' ); -var blockedmap6d = require( './6d_blocked.js' ); -var blockedmap7d = require( './7d_blocked.js' ); -var blockedmap8d = require( './8d_blocked.js' ); -var blockedmap9d = require( './9d_blocked.js' ); -var blockedmap10d = require( './10d_blocked.js' ); -var accessormap0d = require( './0d_accessors.js' ); -var accessormap1d = require( './1d_accessors.js' ); -var accessormap2d = require( './2d_accessors.js' ); -var accessormap3d = require( './3d_accessors.js' ); -var accessormap4d = require( './4d_accessors.js' ); -var accessormap5d = require( './5d_accessors.js' ); -var accessormap6d = require( './6d_accessors.js' ); -var accessormap7d = require( './7d_accessors.js' ); -var accessormap8d = require( './8d_accessors.js' ); -var accessormap9d = require( './9d_accessors.js' ); -var accessormap10d = require( './10d_accessors.js' ); -var accessormapnd = require( './nd_accessors.js' ); -var map0d = require( './0d.js' ); -var map1d = require( './1d.js' ); -var map2d = require( './2d.js' ); -var map3d = require( './3d.js' ); -var map4d = require( './4d.js' ); -var map5d = require( './5d.js' ); -var map6d = require( './6d.js' ); -var map7d = require( './7d.js' ); -var map8d = require( './8d.js' ); -var map9d = require( './9d.js' ); -var map10d = require( './10d.js' ); -var mapnd = require( './nd.js' ); - - -// VARIABLES // - -var MAP = [ - map0d, - map1d, - map2d, - map3d, - map4d, - map5d, - map6d, - map7d, - map8d, - map9d, - map10d -]; -var ACCESSOR_MAP = [ - accessormap0d, - accessormap1d, - accessormap2d, - accessormap3d, - accessormap4d, - accessormap5d, - accessormap6d, - accessormap7d, - accessormap8d, - accessormap9d, - accessormap10d -]; -var BLOCKED_MAP = [ - blockedmap2d, // 0 - blockedmap3d, - blockedmap4d, - blockedmap5d, - blockedmap6d, - blockedmap7d, - blockedmap8d, - blockedmap9d, - blockedmap10d // 8 -]; -var BLOCKED_ACCESSOR_MAP = [ - blockedaccessormap2d, // 0 - blockedaccessormap3d, - blockedaccessormap4d, - blockedaccessormap5d, - blockedaccessormap6d, - blockedaccessormap7d, - blockedaccessormap8d, - blockedaccessormap9d, - blockedaccessormap10d // 8 -]; -var MAX_DIMS = MAP.length -1; - - -// MAIN // - -/** -* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray. -* -* ## Notes -* -* - Each provided ndarray should be an object with the following properties: -* -* - **dtype**: data type. -* - **data**: data buffer. -* - **shape**: dimensions. -* - **strides**: stride lengths. -* - **offset**: index offset. -* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style). -* -* @param {ArrayLikeObject} arrays - array-like object containing one input array and one output array -* @param {Callback} fcn - callback function -* @param {*} [thisArg] - callback execution context -* @throws {Error} arrays must have the same number of dimensions -* @throws {Error} arrays must have the same shape -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( z ) { -* return z * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* var ybuf = new Float64Array( 6 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* var sy = [ 2, 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* map( [ x, y ], scale ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ] -*/ -function map( arrays, fcn, thisArg ) { - var ndims; - var shx; - var shy; - var iox; - var ioy; - var len; - var ord; - var x; - var y; - var i; - var d; - - // Unpack the ndarrays and standardize ndarray meta data: - x = ndarray2object( arrays[ 0 ] ); - y = ndarray2object( arrays[ 1 ] ); - - // Verify that the input and output arrays have the same number of dimensions... - shx = x.shape; - shy = y.shape; - ndims = shx.length; - if ( ndims !== shy.length ) { - throw new Error( format( 'invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == %d. ndims(y) == %d.', ndims, shy.length ) ); - } - // Determine whether we can avoid iteration altogether... - if ( ndims === 0 ) { - if ( x.accessorProtocol || y.accessorProtocol ) { - return ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg ); - } - return MAP[ ndims ]( x, y, fcn, thisArg ); - } - // Verify that the input and output arrays have the same dimensions... - len = 1; // number of elements - for ( i = 0; i < ndims; i++ ) { - d = shx[ i ]; - if ( d !== shy[ i ] ) { - throw new Error( 'invalid arguments. Arrays must have the same shape.' ); - } - // Note that, if one of the dimensions is `0`, the length will be `0`... - len *= d; - } - // Check whether we were provided empty ndarrays... - if ( len === 0 ) { - return; - } - // Determine whether the ndarrays are one-dimensional and thus readily translate to one-dimensional strided arrays... - if ( ndims === 1 ) { - if ( x.accessorProtocol || y.accessorProtocol ) { - return ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg ); - } - return MAP[ ndims ]( x, y, fcn, thisArg ); - } - // Determine iteration order: - iox = iterationOrder( x.strides ); // +/-1 - ioy = iterationOrder( y.strides ); // +/-1 - - // Determine whether we can avoid blocked iteration... - ord = strides2order( x.strides ); - if ( iox !== 0 && ioy !== 0 && ord === strides2order( y.strides ) ) { - // Determine whether we can use simple nested loops... - if ( ndims <= MAX_DIMS ) { - // So long as iteration for each respective array always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration... - if ( x.accessorProtocol || y.accessorProtocol ) { - return ACCESSOR_MAP[ ndims ]( x, y, ord === 1, fcn, thisArg ); - } - return MAP[ ndims ]( x, y, ord === 1, fcn, thisArg ); - } - // Fall-through to blocked iteration... - } - // Determine whether we can perform blocked iteration... - if ( ndims <= MAX_DIMS ) { - if ( x.accessorProtocol || y.accessorProtocol ) { - return BLOCKED_ACCESSOR_MAP[ ndims-2 ]( x, y, fcn, thisArg ); - } - return BLOCKED_MAP[ ndims-2 ]( x, y, fcn, thisArg ); - } - // Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)... - if ( x.accessorProtocol || y.accessorProtocol ) { - return accessormapnd( x, y, fcn, thisArg ); - } - mapnd( x, y, fcn, thisArg ); -} - - -// EXPORTS // - -module.exports = map; diff --git a/lib/nd.js b/lib/nd.js deleted file mode 100644 index 285ba3b..0000000 --- a/lib/nd.js +++ /dev/null @@ -1,154 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); -var ind2sub = require( '@stdlib/ndarray-base-ind2sub' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Applies a callback function to elements in an n-dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function scale( x ) { -* return x * 10.0; -* } -* -* // Create data buffers: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Float64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* var sy = [ 2, 1 ]; -* -* // Define the index offsets: -* var ox = 1; -* var oy = 0; -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* var y = { -* 'dtype': 'float64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major' -* }; -* -* // Apply function: -* mapnd( x, y, scale, {} ); -* -* console.log( y.data ); -* // => [ 20.0, 30.0, 60.0, 70.0 ] -*/ -function mapnd( x, y, fcn, thisArg ) { - var xbuf; - var ybuf; - var ordx; - var ordy; - var len; - var idx; - var sh; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i; - - sh = x.shape; - - // Compute the total number of elements over which to iterate: - len = numel( sh ); - - // Cache references to the input and output ndarray data buffers: - xbuf = x.data; - ybuf = y.data; - - // Cache references to the respective stride arrays: - sx = x.strides; - sy = y.strides; - - // Cache the indices of the first indexed elements in the respective ndarrays: - ox = x.offset; - oy = y.offset; - - // Cache the respective array orders: - ordx = x.order; - ordy = y.order; - - // Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory... - for ( i = 0; i < len; i++ ) { - ix = vind2bind( sh, sx, ox, ordx, i, MODE ); - iy = vind2bind( sh, sy, oy, ordy, i, MODE ); - idx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view - ybuf[ iy ] = fcn.call( thisArg, xbuf[ ix ], idx, x.ref ); - } -} - - -// EXPORTS // - -module.exports = mapnd; diff --git a/lib/nd_accessors.js b/lib/nd_accessors.js deleted file mode 100644 index c6ea4ee..0000000 --- a/lib/nd_accessors.js +++ /dev/null @@ -1,174 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); -var ind2sub = require( '@stdlib/ndarray-base-ind2sub' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Applies a callback function to elements in an -dimensional input ndarray and assigns results to elements in an equivalently shaped output ndarray. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @param {*} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @param {Object} y - object containing output ndarray meta data -* @param {*} y.dtype - data type -* @param {Collection} y.data - data buffer -* @param {NonNegativeIntegerArray} y.shape - dimensions -* @param {IntegerArray} y.strides - stride lengths -* @param {NonNegativeInteger} y.offset - index offset -* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} y.accessors - data buffer accessors -* @param {Callback} fcn - callback function -* @param {*} thisArg - callback execution context -* @returns {void} -* -* @example -* var Complex64Array = require( '@stdlib/array-complex64' ); -* var Complex64 = require( '@stdlib/complex-float32-ctor' ); -* var realf = require( '@stdlib/complex-float32-real' ); -* var imagf = require( '@stdlib/complex-float32-imag' ); -* -* function scale( z ) { -* return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); -* } -* -* // Create data buffers: -* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* var ybuf = new Complex64Array( 4 ); -* -* // Define the shape of the input and output arrays: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 2, 1 ]; -* var sy = [ 2, 1 ]; -* -* // Define the index offsets: -* var ox = 0; -* var oy = 0; -* -* // Define getters and setters: -* function getter( buf, idx ) { -* return buf.get( idx ); -* } -* -* function setter( buf, idx, value ) { -* buf.set( value, idx ); -* } -* -* // Create the input and output ndarray-like objects: -* var x = { -* 'ref': null, -* 'dtype': 'complex64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* var y = { -* 'dtype': 'complex64', -* 'data': ybuf, -* 'shape': shape, -* 'strides': sy, -* 'offset': oy, -* 'order': 'row-major', -* 'accessors': [ getter, setter ] -* }; -* -* // Apply function: -* mapnd( x, y, scale, {} ); -* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] -*/ -function mapnd( x, y, fcn, thisArg ) { - var xbuf; - var ybuf; - var ordx; - var ordy; - var len; - var get; - var set; - var idx; - var sh; - var sx; - var sy; - var ox; - var oy; - var ix; - var iy; - var i; - - sh = x.shape; - - // Compute the total number of elements over which to iterate: - len = numel( sh ); - - // Cache references to the input and output ndarray data buffers: - xbuf = x.data; - ybuf = y.data; - - // Cache references to the respective stride arrays: - sx = x.strides; - sy = y.strides; - - // Cache the indices of the first indexed elements in the respective ndarrays: - ox = x.offset; - oy = y.offset; - - // Cache the respective array orders: - ordx = x.order; - ordy = y.order; - - // Cache accessors: - get = x.accessors[ 0 ]; - set = y.accessors[ 1 ]; - - // Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory... - for ( i = 0; i < len; i++ ) { - ix = vind2bind( sh, sx, ox, ordx, i, MODE ); - iy = vind2bind( sh, sy, oy, ordy, i, MODE ); - idx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view - set( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), idx, x.ref ) ); - } -} - - -// EXPORTS // - -module.exports = mapnd; diff --git a/package.json b/package.json index 4b3abc1..cb59fb5 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.1", "description": "Apply a callback to elements in an input ndarray and assign results to elements in an output ndarray.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,70 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-reverse": "^0.2.3", - "@stdlib/array-base-take-indexed": "^0.2.3", - "@stdlib/array-base-zero-to": "^0.2.2", - "@stdlib/ndarray-base-ind2sub": "^0.2.3", - "@stdlib/ndarray-base-iteration-order": "^0.2.3", - "@stdlib/ndarray-base-ndarraylike2object": "^0.2.3", - "@stdlib/ndarray-base-numel": "^0.2.3", - "@stdlib/ndarray-base-strides2order": "^0.2.3", - "@stdlib/ndarray-base-unary-loop-interchange-order": "^0.3.1", - "@stdlib/ndarray-base-unary-tiling-block-size": "^0.2.3", - "@stdlib/ndarray-base-vind2bind": "^0.2.3", - "@stdlib/string-format": "^0.2.3", - "@stdlib/types": "^0.5.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.3" - }, - "devDependencies": { - "@stdlib/array-complex128": "^0.3.2", - "@stdlib/array-float64": "^0.2.3", - "@stdlib/array-ones": "^0.2.2", - "@stdlib/array-typed-complex-ctors": "^0.2.3", - "@stdlib/array-zeros": "^0.2.3", - "@stdlib/assert-is-same-complex128array": "^0.2.3", - "@stdlib/assert-is-same-float64array": "^0.2.3", - "@stdlib/blas-ext-base-dfill": "^0.3.1", - "@stdlib/blas-ext-base-gfill": "^0.2.3", - "@stdlib/complex-float64-ctor": "^0.1.2", - "@stdlib/complex-float64-imag": "^0.1.2", - "@stdlib/complex-float64-real": "^0.1.2", - "@stdlib/math-base-assert-is-nan": "^0.2.3", - "@stdlib/math-base-special-abs": "^0.2.3", - "@stdlib/math-base-special-cbrt": "^0.2.3", - "@stdlib/math-base-special-floor": "^0.2.4", - "@stdlib/math-base-special-pow": "^0.3.1", - "@stdlib/math-base-special-sqrt": "^0.2.3", - "@stdlib/ndarray-base-shape2strides": "^0.2.3", - "@stdlib/ndarray-base-strides2offset": "^0.2.3", - "@stdlib/ndarray-base-to-array": "^0.2.2", - "@stdlib/ndarray-ctor": "^0.3.1", - "@stdlib/ndarray-data-buffer": "^0.2.3", - "@stdlib/ndarray-from-scalar": "^0.3.1", - "@stdlib/number-float64-base-identity": "^0.1.1", - "@stdlib/random-array-discrete-uniform": "^0.2.2", - "@stdlib/utils-nary-function": "^0.2.4", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.3" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "base", diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..01ba8e4 --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.0d.js b/test/test.0d.js deleted file mode 100644 index ed3d284..0000000 --- a/test/test.0d.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var scalar2ndarray = require( '@stdlib/ndarray-from-scalar' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 0-dimensional ndarray and assigns results to elements in an output 0-dimensional ndarray', function test( t ) { - var expected; - var x; - var y; - - x = scalar2ndarray( 1.0, { - 'dtype': 'float64' - }); - y = scalar2ndarray( 0.0, { - 'dtype': 'float64' - }); - - map( [ x, y ], scale ); - - expected = new Float64Array( [ 10.0 ] ); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 0-dimensional ndarray and assigns results to elements in an output 0-dimensional ndarray (accessors)', function test( t ) { - var expected; - var x; - var y; - - x = scalar2ndarray( new Complex128( 1.0, 1.0 ), { - 'dtype': 'complex128' - }); - y = scalar2ndarray( new Complex128( 0.0, 0.0 ), { - 'dtype': 'complex128' - }); - - map( [ x, y ], scale ); - - expected = new Complex128Array( [ 10.0, 10.0 ] ); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.10d.js b/test/test.10d.js deleted file mode 100644 index 29dd185..0000000 --- a/test/test.10d.js +++ /dev/null @@ -1,2668 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ 32, 16, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, 32, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*32, 16, -8, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*64, bsize*32, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*16, 8, 4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*32, bsize*16, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*16, - -8, - 4, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ - bsize*32, - bsize*32, - bsize*16, - -bsize*16, - bsize*8, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 9 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, -16, 16, -8, -4, -2, 1 ]; - - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ 32, 16, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, 32, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*32, 16, -8, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*64, bsize*32, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*16, 8, 4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*32, bsize*16, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*16, - -8, - 4, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ - bsize*32, - bsize*32, - bsize*16, - -bsize*16, - bsize*8, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 9 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -1, -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, -1, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - -bsize*8, - bsize*8, - bsize*16, - bsize*16, - -bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 2, bsize*2, 2, 1 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 32, bsize*64, bsize*128 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 16, 32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 16, -16, 16, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, -1, 1, -1, 1, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - -bsize*8, - bsize*8, - bsize*16, - bsize*16, - -bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 2, bsize*2, 2, 1 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 32, bsize*64, bsize*128 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 16, 32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 10-dimensional ndarray and assigns results to elements in an output 10-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 16, -16, 16, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.1d.js b/test/test.1d.js deleted file mode 100644 index e337440..0000000 --- a/test/test.1d.js +++ /dev/null @@ -1,135 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 1-dimensional ndarray and assigns results to elements in an output 1-dimensional ndarray', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 8, 'float64' ), [ 4 ], [ 2 ], 1, 'row-major' ); - y = ndarray( 'float64', zeros( 8, 'float64' ), [ 4 ], [ 2 ], 1, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 1-dimensional ndarray and assigns results to elements in an output 1-dimensional ndarray (empty array)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 8, 'float64' ), [ 0 ], [ 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 8, 'float64' ), [ 0 ], [ 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 1-dimensional ndarray and assigns results to elements in an output 1-dimensional ndarray (accessors)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'complex128', ones( 6, 'complex128' ), [ 4 ], [ 1 ], 1, 'row-major' ); - y = ndarray( 'complex128', zeros( 6, 'complex128' ), [ 4 ], [ 1 ], 1, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.2d.js b/test/test.2d.js deleted file mode 100644 index daeb48c..0000000 --- a/test/test.2d.js +++ /dev/null @@ -1,1196 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 11.0, - 5.0, - 11.0, - 5.0, - 11.0, - 5.0, - 11.0, - 5.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )+10.0, imag( z )+5.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0 ], [ 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0 ], [ 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2 ]; - st = [ -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 1 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2 ]; - st = [ bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 1 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2 ]; - st = [ -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 1 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2 ]; - st = [ bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 1 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 11.0, - 5.0, - 11.0, - 5.0, - 11.0, - 5.0, - 11.0, - 5.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )+10.0, imag( z )+5.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0 ], [ 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0 ], [ 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -1, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 1, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 1, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2 ]; - st = [ 2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2 ]; - st = [ -2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -1, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -1, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 1, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 1, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2 ]; - st = [ 2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 2-dimensional ndarray and assigns results to elements in an output 2-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2 ]; - st = [ -2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( x.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.3d.js b/test/test.3d.js deleted file mode 100644 index cd295e2..0000000 --- a/test/test.3d.js +++ /dev/null @@ -1,1332 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0 ], [ 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0 ], [ 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ 3, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 10.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -3, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 10.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 2 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ -8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 2 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, bsize*2 ]; - st = [ bsize*8, bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 2 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2, 2 ]; - st = [ -4, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ 3, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -3, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 2 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ -8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 2 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, bsize*2 ]; - st = [ -bsize*8, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 2 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0 ], [ 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0 ], [ 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ -1, -2, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 1, 2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 1, -2, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ 2, -2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2 ]; - st = [ 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2, 2 ]; - st = [ -1, -2, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 1, 2, 3 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 1, -2, -3 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 6, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 6, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 1 ]; - st = [ 2, -bsize*4, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ 2, -2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 3-dimensional ndarray and assigns results to elements in an output 3-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2 ]; - st = [ 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.4d.js b/test/test.4d.js deleted file mode 100644 index 81e922d..0000000 --- a/test/test.4d.js +++ /dev/null @@ -1,1504 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0 ], [ 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0 ], [ 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ -2, -2, -1, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, 2, 1, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, -2, -1, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ -4, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 3 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 2, 1 ]; - st = [ -bsize*8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 3 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, bsize*2, 1 ]; - st = [ bsize*8, bsize*4, -2, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 3 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, 1, bsize*2 ]; - st = [ bsize*8, bsize*4, bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 3 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, 2, 1, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, -2, -1, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ -4, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 3 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 2, 1 ]; - st = [ -bsize*8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 3 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1 ]; - st = [ -bsize*4, bsize*4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 3 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2 ]; - st = [ -bsize*4, bsize*4, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 3 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0 ], [ 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0 ], [ 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 1, -2, -4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, 1, bsize*2 ]; - st = [ 2, 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, bsize*2, 1 ]; - st = [ 2, 2, -4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, bsize*2, 1, 2 ]; - st = [ 2, 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 1, 2 ]; - st = [ 2, -bsize*4, bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ 2, -bsize*4, -bsize*4, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1 ]; - st = [ 1, 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1 ]; - st = [ 2, 4, -4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 4-dimensional ndarray and assigns results to elements in an output 4-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*4 ]; - st = [ 2, 4, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.5d.js b/test/test.5d.js deleted file mode 100644 index 312c1d1..0000000 --- a/test/test.5d.js +++ /dev/null @@ -1,1741 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2, 1, 2, 2 ]; - st = [ -8, -4, -4, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 4, 2, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 4, -2, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 4 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, -4, 4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 4 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 4 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 1 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 4 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 4 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ -4, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 4, 2, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 4, -2, -2, -1 ]; - - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 4 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, -4, 4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 4 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 4 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 4 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 4 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 2 ]; - st = [ -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 2, 2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 2, -2, -4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ -2, bsize*4, -bsize*4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ -2, 4, -bsize*8, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ -2, 4, -4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ -2, 4, -4, 4, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ -2, 4, -4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 2, 2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 2, -2, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ -2, bsize*4, -bsize*4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1 ]; - st = [ -2, 4, -bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ -2, 4, -4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ -2, -4, -4, 4, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 5-dimensional ndarray and assigns results to elements in an output 5-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ 2, 4, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.6d.js b/test/test.6d.js deleted file mode 100644 index 759b2e0..0000000 --- a/test/test.6d.js +++ /dev/null @@ -1,1893 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, 4, 4, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, -16, 8, -4, 4, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 8, -8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 5 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ bsize*8, -4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 5 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, -bsize*8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 5 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 5 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 5 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 5 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, 4, 4, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, -4, -4, -1 ]; - - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 8, -8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 5 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ bsize*8, -4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 5 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, -bsize*8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 5 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 5 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 5 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 5 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 1, -1, 1, -2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ 2, 4, bsize*8, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, -4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 1 ]; - st = [ 2, 4, 4, -4, 8, -bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ 2, 4, 4, -8, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 2, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, -2, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 12, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 12, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ 2, 4, bsize*8, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, -4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 1 ]; - st = [ 2, 4, 4, -4, 8, -bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 6-dimensional ndarray and assigns results to elements in an output 6-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ 2, 4, 4, -8, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.7d.js b/test/test.7d.js deleted file mode 100644 index ee61417..0000000 --- a/test/test.7d.js +++ /dev/null @@ -1,2100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -16, 16, -16, 8, -4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 16, -16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 2, 1, 1, 2 ]; - st = [ bsize*16, -8, 8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ bsize*16, -bsize*16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 6 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -8, -8, -4, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -16, 16, -16, -8, 4, -2, 1 ]; - - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 16, -16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ bsize*16, -8, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ bsize*16, -bsize*16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, 1, bsize*2, 2 ]; - st = [ bsize*16, -bsize*16, bsize*16, bsize*8, -bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 6 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, -1, 2, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 2, -bsize*4, bsize*4, bsize*8, -bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 2, 1, 2, 1 ]; - st = [ 2, -4, bsize*8, bsize*8, -bsize*16, bsize*16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 2, 1, 2 ]; - st = [ 2, -4, -4, 4, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ 2, -4, -4, 8, 8, 8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ 2, -4, -4, 8, 8, 16, 16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -1, 1, -1, -2, 4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 2, -bsize*4, -bsize*4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, -bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2, 2 ]; - st = [ 2, -4, -4, 4, bsize*8, bsize*8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ 2, -4, -4, 8, 8, 8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 7-dimensional ndarray and assigns results to elements in an output 7-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ 2, -4, -4, 8, 8, 16, 16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.8d.js b/test/test.8d.js deleted file mode 100644 index 4652207..0000000 --- a/test/test.8d.js +++ /dev/null @@ -1,2222 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 2 ]; - st = [ 32, -16, 8, -8, -8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 2 ]; - st = [ -bsize*32, -16, 8, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 2, 1, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, 16, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*32, -16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*16, -bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*16, -bsize*16, -bsize*16, 8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 2 ]; - st = [ -bsize*16, -bsize*16, bsize*8, -bsize*8, -bsize*8, bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, 1, bsize*2 ]; - st = [ - -bsize*16, - -bsize*16, - bsize*8, - -bsize*8, - -bsize*8, - bsize*4, - -bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 7 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, -16, 16, -8, -4, -2, 1 ]; - - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 2 ]; - st = [ 32, 16, 8, -8, -8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 2 ]; - st = [ -bsize*32, -16, 8, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, bsize*2, 2, 1, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, 16, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, bsize*2, 2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*32, -16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, bsize*2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*16, -bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*16, -bsize*16, -bsize*16, 8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 2 ]; - st = [ -bsize*16, -bsize*16, bsize*8, -bsize*8, -bsize*8, bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, 1, bsize*2 ]; - st = [ - -bsize*16, - -bsize*16, - bsize*8, - -bsize*8, - -bsize*8, - bsize*4, - -bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 7 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, -1, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, bsize*8, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 2, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, 16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -1, 1, -1, 1, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, bsize*8, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 2, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, 16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 8-dimensional ndarray and assigns results to elements in an output 8-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.9d.js b/test/test.9d.js deleted file mode 100644 index cb0580e..0000000 --- a/test/test.9d.js +++ /dev/null @@ -1,2448 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var dfill = require( '@stdlib/blas-ext-base-dfill' ); -var gfill = require( '@stdlib/blas-ext-base-gfill' ); -var blockSize = require( '@stdlib/ndarray-base-unary-tiling-block-size' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'row-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ 32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*32, -16, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, 16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*32, bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - -bsize*64, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - -4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 8 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, -16, 16, -8, -4, -2, 1 ]; - - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ 32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*32, -16, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, 16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*32, bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - -bsize*64, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - -4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (row-major, non-contiguous, large arrays, accessors', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 8 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, empty)', function test( t ) { - var expected; - var x; - var y; - - x = ndarray( 'float64', ones( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - y = ndarray( 'float64', zeros( 4, 'float64' ), [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ], 0, 'column-major' ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, contiguous, negative strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 1, 1, 1, 1, 1 ]; - st = [ -1, -2, -4, -4, -8, -8, -8, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, -1, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1, 1, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 1, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32, bsize*32 ]; // eslint-disable-line max-len - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array( y.length*2 ); - dfill( y.length, 10.0, expected, st[ 0 ] ); - - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, contiguous, negative strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 1, 1, 1, 1, 1 ]; - st = [ -1, -2, -4, -4, -8, -8, -8, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, -1, 1, -1, 1, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, bsize*2, 2, 1, 1, 1, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 1, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32, bsize*32 ]; // eslint-disable-line max-len - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element in an input 9-dimensional ndarray and assigns results to elements in an output 9-dimensional ndarray (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var expected; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt, dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array( y.length*2 ); - gfill( y.length, new Complex128( 10.0, 0.0 ), expected, st[ 0 ] ); - - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 5512e2c..0000000 --- a/test/test.js +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-len */ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error if provided input and output ndarrays which do not have the same number of dimensions', function test( t ) { - var shapes; - var i; - - shapes = [ - [ [ 4, 2, 1 ], [ 4, 2 ] ], - [ [ 2, 2 ], [ 2, 2, 2 ] ], - [ [ 1, 1, 1, 1 ], [ 1, 1, 1 ] ], - [ [ 2, 2, 1, 2 ], [ 2, 1, 2 ] ], - [ [ 1, 1, 4, 2, 2, 2 ], [ 10, 2 ] ], - [ [ 1, 1, 1, 1 ], [ 1, 1, 1 ] ] - ]; - - for ( i = 0; i < shapes.length; i++ ) { - t.throws( badValue( shapes[i][0], shapes[i][1] ), Error, 'throws an error when input shape is ' + shapes[i][0] + ' and output shape is ' + shapes[i][1] ); - } - t.end(); - - function scale( z ) { - return z * 10.0; - } - - function badValue( sh1, sh2 ) { - return function badValue() { - var dtype; - var ord; - var st1; - var st2; - var o1; - var o2; - var x; - var y; - - ord = 'row-major'; - dtype = 'float64'; - - st1 = shape2strides( sh1, ord ); - st2 = shape2strides( sh2, ord ); - o1 = strides2offset( sh1, st1 ); - o2 = strides2offset( sh2, st2 ); - - x = ndarray( dtype, ones( numel( sh1 ), dtype ), sh1, st1, o1, ord ); - y = ndarray( dtype, zeros( numel( sh2 ), dtype ), sh2, st2, o2, ord ); - - map( [ x, y ], scale ); - }; - } -}); - -tape( 'the function throws an error if provided input and output ndarrays which do not have the same shape', function test( t ) { - var shapes; - var i; - - shapes = [ - [ [ 4, 2, 1 ], [ 4, 2, 2 ] ], - [ [ 3, 3 ], [ 2, 2 ] ], - [ [ 5, 5, 5 ], [ 5, 5, 4 ] ], - [ [ 1, 1, 1 ], [ 2, 2, 2 ] ], - [ [ 1, 4, 1, 2, 2 ], [ 3, 8 ] ], - [ [ 10, 2, 1 ], [ 1, 2, 10 ] ] - ]; - - for ( i = 0; i < shapes.length; i++ ) { - t.throws( badValue( shapes[i][0], shapes[i][1] ), Error, 'throws an error when input shape is ' + shapes[i][0] + ' and output shape is ' + shapes[i][1] ); - } - t.end(); - - function scale( z ) { - return z * 10.0; - } - - function badValue( sh1, sh2 ) { - return function badValue() { - var dtype; - var ord; - var st1; - var st2; - var o1; - var o2; - var x; - var y; - - ord = 'row-major'; - dtype = 'float64'; - - st1 = shape2strides( sh1, ord ); - st2 = shape2strides( sh2, ord ); - o1 = strides2offset( sh1, st1 ); - o2 = strides2offset( sh2, st2 ); - - x = ndarray( dtype, ones( numel( sh1 ), dtype ), sh1, st1, o1, ord ); - y = ndarray( dtype, zeros( numel( sh2 ), dtype ), sh2, st2, o2, ord ); - - map( [ x, y ], scale ); - }; - } -}); diff --git a/test/test.nd.js b/test/test.nd.js deleted file mode 100644 index b1a2530..0000000 --- a/test/test.nd.js +++ /dev/null @@ -1,823 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' ); -var isSameFloat64Array = require( '@stdlib/assert-is-same-float64array' ); -var Complex128Array = require( '@stdlib/array-complex128' ); -var Float64Array = require( '@stdlib/array-float64' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var getData = require( '@stdlib/ndarray-data-buffer' ); -var map = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof map, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, -16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, singleton dimensions)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, singleton dimensions, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, contiguous)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0, - 10.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape('the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, non-contiguous, same sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset(sh, st); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape('the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, -1, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Float64Array([ - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0, - 10.0, - 10.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return z * 10.0; - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, contiguous, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -}); - -tape( 'the function applies a callback to each indexed element of an input n-dimensional ndarray and assigns results to elements in an output n-dimensional ndarray (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var expected; - var ord; - var sh; - var st; - var dt; - var o; - var x; - var y; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, -1, 1, -1, 1, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - y = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - map( [ x, y ], scale ); - - expected = new Complex128Array([ - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10.0, - 0.0, - 10.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0 - ]); - t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' ); - - t.end(); - - function scale( z ) { - return new Complex128( real( z )*10.0, imag( z )*10.0 ); - } -});