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/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 73cd687..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/every) 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 6d2d0c1..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/every) 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 89a8e85..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: '38 14 * * 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
+```
-```javascript
-var every = require( '@stdlib/ndarray-base-every' );
+If no recognized module system is present, access bundle contents via the global scope:
+
+```html
+
```
#### every( arrays )
@@ -138,10 +144,15 @@ The provided ndarray should be an object with the following properties:
-```javascript
-var bernoulli = require( '@stdlib/random-array-bernoulli' );
-var ndarray2array = require( '@stdlib/ndarray-base-to-array' );
-var every = require( '@stdlib/ndarray-base-every' );
+```html
+
+
+
+
+
+
+
+
+
```
@@ -165,5361 +181,7 @@ console.log( out );
-* * *
-
-
-
-## C APIs
-
-
-
-
-
-Character codes for data types:
-
-
-
-
-
-- **x**: `bool` (boolean).
-- **z**: `complex128` (double-precision floating-point complex number).
-- **c**: `complex64` (single-precision floating-point complex number).
-- **f**: `float32` (single-precision floating-point number).
-- **d**: `float64` (double-precision floating-point number).
-- **k**: `int16` (signed 16-bit integer).
-- **i**: `int32` (signed 32-bit integer).
-- **s**: `int8` (signed 8-bit integer).
-- **t**: `uint16` (unsigned 16-bit integer).
-- **u**: `uint32` (unsigned 32-bit integer).
-- **b**: `uint8` (unsigned 8-bit integer).
-
-
-
-Function name suffix naming convention:
-
-```text
-stdlib_ndarray_every__
-```
-
-For example,
-
-
-
-```c
-void stdlib_ndarray_every_d_x(...) {...}
-```
-
-is a function which accepts one double-precision floating-point input ndarray and one boolean output ndarray.
-
-Function name suffix naming convention for applying a predicate function:
-
-```text
-stdlib_ndarray_every_by__[_as__]
-```
-
-For example,
-
-
-
-```c
-void stdlib_ndarray_every_by_d_x(...) {...}
-```
-
-is a function which accepts one double-precision floating-point input ndarray and one boolean output ndarray. In other words, the suffix encodes the function type signature.
-
-To support callbacks whose input arguments are of a different data type than the input ndarray data type, the naming convention supports appending an `as` suffix. For example,
-
-
-
-```c
-void stdlib_ndarray_every_by_f_x_as_d_x(...) {...}
-```
-
-is a function which accepts one single-precision floating-point input ndarray and one boolean output ndarray. However, the callback accepts double-precision floating-point numbers. Accordingly, the input values need to be cast using the following conversion sequence
-
-
-
-```c
-#include
-
-// Convert each input array element to double-precision:
-double in1 = (double)x[ i ];
-
-// Evaluate the callback:
-bool out = f( in1 );
-```
-
-
-
-
-
-
-
-
-
-### Usage
-
-```c
-#include "stdlib/ndarray/base/every.h"
-```
-
-
-
-
-
-#### stdlib_ndarray_every_b_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_b_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_b_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_c_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 16, 8 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_c_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_c_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_d_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 16, 8 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_d_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_d_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_f_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_f_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_f_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_i_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_i_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_i_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_k_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_k_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_k_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_s_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_s_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_s_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_t_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_t_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_t_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_u_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_u_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_u_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_x_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_x_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_x_x( struct ndarray *arrays[], void *data );
-```
-
-#### stdlib_ndarray_every_z_x( \*arrays\[], \*data )
-
-Tests whether every element in an input ndarray is truthy.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 32, 16 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_z_x( arrays, NULL );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray.
-- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer.
-
-```c
-int8_t stdlib_ndarray_every_z_x( struct ndarray *arrays[], void *data );
-```
-
-
-
-
-
-#### stdlib_ndarray_every_by_b_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const uint8_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(uint8_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_c_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex64_t x ) {
- return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_c_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_c_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_f_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const float x ) {
- return x == 0.0f;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_f_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_f_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_i_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_i_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_i_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_k_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int16_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_k_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int16_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_k_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_t_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const uint16_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_t_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(uint16_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_t_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_u_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const uint32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_u_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(uint32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_u_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_b_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_b_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_b_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_c_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 16, 8 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex64_t x ) {
- return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_c_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_c_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_c_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 16, 8 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_c_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_c_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 16, 8 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_d_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 16, 8 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_d_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_d_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_f_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const float x ) {
- return x == 0.0f;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_f_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_f_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_f_x_as_c_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex64_t x ) {
- return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_f_x_as_c_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_f_x_as_c_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_f_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_f_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_f_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_f_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_f_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_f_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_i_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_i_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_i_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_i_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_i_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_i_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_i_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_i_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_i_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_k_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int16_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_k_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int16_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_k_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_k_x_as_c_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex64_t x ) {
- return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_k_x_as_c_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_k_x_as_c_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_k_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_k_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_k_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_k_x_as_f_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const float x ) {
- return x == 0.0f;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_k_x_as_f_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_k_x_as_f_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_k_x_as_i_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_k_x_as_i_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_k_x_as_i_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_k_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_k_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_k_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int8_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int8_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x_as_c_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex64_t x ) {
- return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x_as_c_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x_as_c_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x_as_f_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const float x ) {
- return x == 0.0f;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x_as_f_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x_as_f_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x_as_i_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x_as_i_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x_as_i_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x_as_k_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int16_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x_as_k_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int16_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x_as_k_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_s_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_s_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_s_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const uint16_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(uint16_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x_as_c_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float32/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex64_t x ) {
- return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x_as_c_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x_as_c_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x_as_f_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const float x ) {
- return x == 0.0f;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x_as_f_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x_as_f_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x_as_i_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const int32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x_as_i_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x_as_i_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x_as_u_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const uint32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x_as_u_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(uint32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x_as_u_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_t_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 4, 2 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_t_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_t_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_u_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const uint32_t x ) {
- return x == 0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_u_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(uint32_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_u_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_u_x_as_d_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const double x ) {
- return x == 0.0;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_u_x_as_d_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_u_x_as_d_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_u_x_as_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 8, 4 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_u_x_as_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_u_x_as_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_x_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 2, 1 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const bool x ) {
- return x;
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_x_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(bool)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_x_x( struct ndarray *arrays[], void *fcn );
-```
-
-#### stdlib_ndarray_every_by_z_x( \*arrays\[], \*fcn )
-
-Tests whether every element in an input ndarray is truthy according to a predicate function.
-
-```c
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include "stdlib/complex/float64/ctor.h"
-#include
-#include
-#include
-#include
-
-// Define the ndarray data types:
-enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128;
-enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
-// Create underlying byte arrays:
-uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-uint8_t ybuf[] = { 0 };
-
-// Define the number of dimensions:
-int64_t ndims = 2;
-
-// Define the array shapes:
-int64_t shx[] = { 2, 2 };
-int64_t *shy = NULL;
-
-// Define the strides:
-int64_t sx[] = { 32, 16 };
-int64_t sy[] = { 0 };
-
-// Define the index offsets:
-int64_t ox = 0;
-int64_t oy = 0;
-
-// Define the array order:
-enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
-// Specify the index mode:
-enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
-// Specify the subscript index modes:
-int8_t submodes[] = { imode };
-int64_t nsubmodes = 1;
-
-// Create an input ndarray:
-struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
-if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an output ndarray:
-struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
-if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
-}
-
-// Create an array containing the ndarrays:
-struct ndarray *arrays[] = { x, y };
-
-// Define a callback:
-static bool fcn( const stdlib_complex128_t x ) {
- return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );
-}
-
-// Test elements:
-int8_t status = stdlib_ndarray_every_by_z_x( arrays, (void *)fcn );
-if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
-}
-
-// ...
-
-// Free allocated memory:
-stdlib_ndarray_free( x );
-stdlib_ndarray_free( y );
-```
-
-The function accepts the following arguments:
-
-- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
-- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer.
-
-```c
-int8_t stdlib_ndarray_every_by_z_x( struct ndarray *arrays[], void *fcn );
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-* * *
-
-
-
-### Examples
-
-```c
-#include "stdlib/ndarray/base/every.h"
-#include "stdlib/ndarray/dtypes.h"
-#include "stdlib/ndarray/index_modes.h"
-#include "stdlib/ndarray/orders.h"
-#include "stdlib/ndarray/ctor.h"
-#include
-#include
-#include
-#include
-#include
-
-static void print_ndarray_contents( const struct ndarray *x ) {
- int64_t i;
- int8_t s;
- bool v;
-
- for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) {
- s = stdlib_ndarray_iget_bool( x, i, &v );
- if ( s != 0 ) {
- fprintf( stderr, "Unable to resolve data element.\n" );
- exit( EXIT_FAILURE );
- }
- fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" );
- }
-}
-
-static bool fcn( const uint8_t x ) {
- return ( x != 0 );
-}
-
-int main( void ) {
- // Define the ndarray data types:
- enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8;
- enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
-
- // Create underlying byte arrays:
- uint8_t xbuf[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
- uint8_t ybuf[] = { 0 };
-
- // Define the number of input array dimensions:
- int64_t ndims = 3;
-
- // Define the array shapes:
- int64_t shx[] = { 2, 2, 2 };
- int64_t *shy = NULL;
-
- // Define the strides:
- int64_t sx[] = { 4, 2, 1 };
- int64_t sy[] = { 0 };
-
- // Define the offsets:
- int64_t ox = 0;
- int64_t oy = 0;
-
- // Define the array order:
- enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
-
- // Specify the index mode:
- enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
-
- // Specify the subscript index modes:
- int8_t submodes[] = { imode };
- int64_t nsubmodes = 1;
-
- // Create an input ndarray:
- struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes );
- if ( x == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
- }
-
- // Create an output ndarray:
- struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes );
- if ( y == NULL ) {
- fprintf( stderr, "Error allocating memory.\n" );
- exit( EXIT_FAILURE );
- }
-
- // Define an array containing the ndarrays:
- struct ndarray *arrays[] = { x, y };
-
- // Test elements:
- int8_t status = stdlib_ndarray_every_by_b_x( arrays, (void *)fcn );
- if ( status != 0 ) {
- fprintf( stderr, "Error during computation.\n" );
- exit( EXIT_FAILURE );
- }
-
- // Print the results:
- print_ndarray_contents( y );
- fprintf( stdout, "\n" );
-
- // Free allocated memory:
- stdlib_ndarray_free( x );
- stdlib_ndarray_free( y );
-}
-```
-
-
-
-
-
-
-
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 47f4112..0000000
--- a/benchmark/benchmark.10d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.10d_blocked_rowmajor.js b/benchmark/benchmark.10d_blocked_rowmajor.js
deleted file mode 100644
index 7fefd00..0000000
--- a/benchmark/benchmark.10d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.10d_columnmajor.js b/benchmark/benchmark.10d_columnmajor.js
deleted file mode 100644
index fe27254..0000000
--- a/benchmark/benchmark.10d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.10d_rowmajor.js b/benchmark/benchmark.10d_rowmajor.js
deleted file mode 100644
index 1c750a6..0000000
--- a/benchmark/benchmark.10d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.11d_columnmajor.js b/benchmark/benchmark.11d_columnmajor.js
deleted file mode 100644
index 51fdc44..0000000
--- a/benchmark/benchmark.11d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.11d_rowmajor.js b/benchmark/benchmark.11d_rowmajor.js
deleted file mode 100644
index 8217bb8..0000000
--- a/benchmark/benchmark.11d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.1d_columnmajor.js b/benchmark/benchmark.1d_columnmajor.js
deleted file mode 100644
index 807e357..0000000
--- a/benchmark/benchmark.1d_columnmajor.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( [ x ] );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.1d_rowmajor.js b/benchmark/benchmark.1d_rowmajor.js
deleted file mode 100644
index 0d1ca36..0000000
--- a/benchmark/benchmark.1d_rowmajor.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( [ x ] );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d_blocked_columnmajor.js b/benchmark/benchmark.2d_blocked_columnmajor.js
deleted file mode 100644
index 0947d28..0000000
--- a/benchmark/benchmark.2d_blocked_columnmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d_blocked_rowmajor.js b/benchmark/benchmark.2d_blocked_rowmajor.js
deleted file mode 100644
index dab0fc7..0000000
--- a/benchmark/benchmark.2d_blocked_rowmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d_columnmajor.js b/benchmark/benchmark.2d_columnmajor.js
deleted file mode 100644
index 5f26827..0000000
--- a/benchmark/benchmark.2d_columnmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d_rowmajor.js b/benchmark/benchmark.2d_rowmajor.js
deleted file mode 100644
index b59104f..0000000
--- a/benchmark/benchmark.2d_rowmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d_rowmajor_accessors.js b/benchmark/benchmark.2d_rowmajor_accessors.js
deleted file mode 100644
index a0dc927..0000000
--- a/benchmark/benchmark.2d_rowmajor_accessors.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- '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 out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 bb0884d..0000000
--- a/benchmark/benchmark.2d_rowmajor_accessors_complex.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = require( './../lib/2d_accessors.js' );
-
-
-// VARIABLES //
-
-var types = [ 'complex64' ];
-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.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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var xbuf;
- var x;
-
- xbuf = discreteUniform( len*2, 1, 100 );
- x = {
- 'dtype': xtype,
- 'data': new ( ctors( xtype ) )( xbuf.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 out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 5; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.3d_blocked_columnmajor.js b/benchmark/benchmark.3d_blocked_columnmajor.js
deleted file mode 100644
index f8f0468..0000000
--- a/benchmark/benchmark.3d_blocked_columnmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( cbrt( len ) );
- sh = [ len, len, len ];
- len *= len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.3d_blocked_rowmajor.js b/benchmark/benchmark.3d_blocked_rowmajor.js
deleted file mode 100644
index c48c918..0000000
--- a/benchmark/benchmark.3d_blocked_rowmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( cbrt( len ) );
- sh = [ len, len, len ];
- len *= len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.3d_columnmajor.js b/benchmark/benchmark.3d_columnmajor.js
deleted file mode 100644
index 08236f5..0000000
--- a/benchmark/benchmark.3d_columnmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( cbrt( len ) );
- sh = [ len, len, len ];
- len *= len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.3d_rowmajor.js b/benchmark/benchmark.3d_rowmajor.js
deleted file mode 100644
index 1438da2..0000000
--- a/benchmark/benchmark.3d_rowmajor.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-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 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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( cbrt( len ) );
- sh = [ len, len, len ];
- len *= len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.4d_blocked_columnmajor.js b/benchmark/benchmark.4d_blocked_columnmajor.js
deleted file mode 100644
index 68a3623..0000000
--- a/benchmark/benchmark.4d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/4.0 ) );
- sh = [ len, len, len, len ];
- len *= len * len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.4d_blocked_rowmajor.js b/benchmark/benchmark.4d_blocked_rowmajor.js
deleted file mode 100644
index 6aa939f..0000000
--- a/benchmark/benchmark.4d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/4.0 ) );
- sh = [ len, len, len, len ];
- len *= len * len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.4d_columnmajor.js b/benchmark/benchmark.4d_columnmajor.js
deleted file mode 100644
index fb42ad0..0000000
--- a/benchmark/benchmark.4d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/4.0 ) );
- sh = [ len, len, len, len ];
- len *= len * len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.4d_rowmajor.js b/benchmark/benchmark.4d_rowmajor.js
deleted file mode 100644
index 4a05b75..0000000
--- a/benchmark/benchmark.4d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/4.0 ) );
- sh = [ len, len, len, len ];
- len *= len * len * len;
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.5d_blocked_columnmajor.js b/benchmark/benchmark.5d_blocked_columnmajor.js
deleted file mode 100644
index 9e1314f..0000000
--- a/benchmark/benchmark.5d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/5.0 ) );
- sh = [ len, len, len, len, len ];
- len *= pow( len, 4 );
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.5d_blocked_rowmajor.js b/benchmark/benchmark.5d_blocked_rowmajor.js
deleted file mode 100644
index f86f46c..0000000
--- a/benchmark/benchmark.5d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/5.0 ) );
- sh = [ len, len, len, len, len ];
- len *= pow( len, 4 );
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.5d_columnmajor.js b/benchmark/benchmark.5d_columnmajor.js
deleted file mode 100644
index 9892e2c..0000000
--- a/benchmark/benchmark.5d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/5.0 ) );
- sh = [ len, len, len, len, len ];
- len *= pow( len, 4 );
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.5d_rowmajor.js b/benchmark/benchmark.5d_rowmajor.js
deleted file mode 100644
index ba28f21..0000000
--- a/benchmark/benchmark.5d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2, 1, 1, 1 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- len = floor( pow( len, 1.0/5.0 ) );
- sh = [ len, len, len, len, len ];
- len *= pow( len, 4 );
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.6d_blocked_columnmajor.js b/benchmark/benchmark.6d_blocked_columnmajor.js
deleted file mode 100644
index 4d8ac44..0000000
--- a/benchmark/benchmark.6d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.6d_blocked_rowmajor.js b/benchmark/benchmark.6d_blocked_rowmajor.js
deleted file mode 100644
index cd4d840..0000000
--- a/benchmark/benchmark.6d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.6d_columnmajor.js b/benchmark/benchmark.6d_columnmajor.js
deleted file mode 100644
index 4250d72..0000000
--- a/benchmark/benchmark.6d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.6d_rowmajor.js b/benchmark/benchmark.6d_rowmajor.js
deleted file mode 100644
index 6e70436..0000000
--- a/benchmark/benchmark.6d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.7d_blocked_columnmajor.js b/benchmark/benchmark.7d_blocked_columnmajor.js
deleted file mode 100644
index b3b8ccd..0000000
--- a/benchmark/benchmark.7d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.7d_blocked_rowmajor.js b/benchmark/benchmark.7d_blocked_rowmajor.js
deleted file mode 100644
index 403140d..0000000
--- a/benchmark/benchmark.7d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.7d_columnmajor.js b/benchmark/benchmark.7d_columnmajor.js
deleted file mode 100644
index a2cda94..0000000
--- a/benchmark/benchmark.7d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.7d_rowmajor.js b/benchmark/benchmark.7d_rowmajor.js
deleted file mode 100644
index 203d441..0000000
--- a/benchmark/benchmark.7d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.8d_blocked_columnmajor.js b/benchmark/benchmark.8d_blocked_columnmajor.js
deleted file mode 100644
index ef09adc..0000000
--- a/benchmark/benchmark.8d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.8d_blocked_rowmajor.js b/benchmark/benchmark.8d_blocked_rowmajor.js
deleted file mode 100644
index ef09adc..0000000
--- a/benchmark/benchmark.8d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.8d_columnmajor.js b/benchmark/benchmark.8d_columnmajor.js
deleted file mode 100644
index d891533..0000000
--- a/benchmark/benchmark.8d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.8d_rowmajor.js b/benchmark/benchmark.8d_rowmajor.js
deleted file mode 100644
index c976ed4..0000000
--- a/benchmark/benchmark.8d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.9d_blocked_columnmajor.js b/benchmark/benchmark.9d_blocked_columnmajor.js
deleted file mode 100644
index e793f79..0000000
--- a/benchmark/benchmark.9d_blocked_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.9d_blocked_rowmajor.js b/benchmark/benchmark.9d_blocked_rowmajor.js
deleted file mode 100644
index 06ab0b8..0000000
--- a/benchmark/benchmark.9d_blocked_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.9d_columnmajor.js b/benchmark/benchmark.9d_columnmajor.js
deleted file mode 100644
index 7a952b4..0000000
--- a/benchmark/benchmark.9d_columnmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.9d_rowmajor.js b/benchmark/benchmark.9d_rowmajor.js
deleted file mode 100644
index 0ae883f..0000000
--- a/benchmark/benchmark.9d_rowmajor.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
-var pow = require( '@stdlib/math-base-special-pow' );
-var floor = require( '@stdlib/math-base-special-floor' );
-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 every = 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 - ndarray data type
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype ) {
- var x;
-
- x = discreteUniform( len, 1, 100, {
- 'dtype': xtype
- });
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = every( x );
- if ( typeof out !== 'boolean' ) {
- b.fail( 'should return a boolean' );
- }
- }
- b.toc();
- if ( !isBoolean( out ) ) {
- b.fail( 'should return a boolean' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var len;
- var min;
- var max;
- var sh;
- var t1;
- var f;
- var i;
- var j;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- for ( j = 0; j < types.length; j++ ) {
- t1 = 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
-
- sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ];
- f = createBenchmark( len, sh, t1 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), 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 );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f );
- }
- }
-}
-
-main();
diff --git a/branches.md b/branches.md
deleted file mode 100644
index 01fb2ff..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/every"
-%% click B href "https://github.com/stdlib-js/ndarray-base-every/tree/main"
-%% click C href "https://github.com/stdlib-js/ndarray-base-every/tree/production"
-%% click D href "https://github.com/stdlib-js/ndarray-base-every/tree/esm"
-%% click E href "https://github.com/stdlib-js/ndarray-base-every/tree/deno"
-%% click F href "https://github.com/stdlib-js/ndarray-base-every/tree/umd"
-```
-
-[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/every
-[production-url]: https://github.com/stdlib-js/ndarray-base-every/tree/production
-[deno-url]: https://github.com/stdlib-js/ndarray-base-every/tree/deno
-[deno-readme]: https://github.com/stdlib-js/ndarray-base-every/blob/deno/README.md
-[umd-url]: https://github.com/stdlib-js/ndarray-base-every/tree/umd
-[umd-readme]: https://github.com/stdlib-js/ndarray-base-every/blob/umd/README.md
-[esm-url]: https://github.com/stdlib-js/ndarray-base-every/tree/esm
-[esm-readme]: https://github.com/stdlib-js/ndarray-base-every/blob/esm/README.md
\ No newline at end of file
diff --git a/browser.js b/browser.js
new file mode 100644
index 0000000..c6f0c2e
--- /dev/null
+++ b/browser.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+var r,t;r=this,t=function(){"use strict";var r=8,t=16,e=1,n="function"==typeof Object.defineProperty?Object.defineProperty:null,o=Object.defineProperty;function i(r){return"number"==typeof r}function a(r){var t,e="";for(t=0;t0&&(e-=1),n=r.toExponential(e)):n=r.toPrecision(t.precision),t.alternate||(n=y.call(n,E,"$1e"),n=y.call(n,b,"e"),n=y.call(n,w,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return n=y.call(n,g,"e+0$1"),n=y.call(n,m,"e-0$1"),t.alternate&&(n=y.call(n,v,"$1."),n=y.call(n,d,"$1.e")),r>=0&&t.sign&&(n=t.sign+n),n=t.specifier===p.call(t.specifier)?p.call(n):c.call(n)}function T(r){var t,e="";for(t=0;t127)throw new Error("invalid character code. Value: "+n.arg);n.arg=A(a)?String(n.arg):x(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(t||(n.precision=6),h=parseFloat(n.arg),!isFinite(h)){if(!i(n.arg))throw new Error("invalid floating-point number. Value: "+u);h=n.arg,n.padZeros=!1}n.arg=_(h,n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=f(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(y=n.arg,g=n.width,m=n.padRight,v=void 0,(v=g-y.length)<0?y:y=m?y+T(v):T(v)+y)),u+=n.arg||"",s+=1}return u}var F=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function L(r){var t={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(t.precision="1"),t}function O(r){var t,e,n,o;for(e=[],o=0,n=F.exec(r);n;)(t=r.slice(o,F.lastIndex-n[0].length)).length&&e.push(t),"%"===n[6]?e.push("%"):e.push(L(n)),o=F.lastIndex,n=F.exec(r);return(t=r.slice(o)).length&&e.push(t),e}function I(r){var t,e;if("string"!=typeof r)throw new TypeError(I("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[O(r)],e=1;e0?i+=a*(r[f]-1):a<0&&(o+=a*(r[f]-1))}return[o,i]}Y(W,"assign",(function(r,t,e,n){var o,i,a,f,u;for(o=r.length,i=e,a=e,u=0;u0?a+=f*(r[u]-1):f<0&&(i+=f*(r[u]-1))}return n[0]=i,n[1]=a,n}));var Z="function";function $(r){return typeof r.get===Z&&typeof r.set===Z}var G={complex128:function(r,t){return r.get(t)},complex64:function(r,t){return r.get(t)},default:function(r,t){return r.get(t)}};function K(r){var t=G[r];return"function"==typeof t?t:G.default}var X={complex128:function(r,t,e){r.set(e,t)},complex64:function(r,t,e){r.set(e,t)},default:function(r,t,e){r.set(e,t)}};function z(r){var t=X[r];return"function"==typeof t?t:X.default}var H={float64:function(r,t){return r[t]},float32:function(r,t){return r[t]},int32:function(r,t){return r[t]},int16:function(r,t){return r[t]},int8:function(r,t){return r[t]},uint32:function(r,t){return r[t]},uint16:function(r,t){return r[t]},uint8:function(r,t){return r[t]},uint8c:function(r,t){return r[t]},generic:function(r,t){return r[t]},default:function(r,t){return r[t]}};function J(r){var t=H[r];return"function"==typeof t?t:H.default}var D={float64:function(r,t,e){r[t]=e},float32:function(r,t,e){r[t]=e},int32:function(r,t,e){r[t]=e},int16:function(r,t,e){r[t]=e},int8:function(r,t,e){r[t]=e},uint32:function(r,t,e){r[t]=e},uint16:function(r,t,e){r[t]=e},uint8:function(r,t,e){r[t]=e},uint8c:function(r,t,e){r[t]=e},generic:function(r,t,e){r[t]=e},default:function(r,t,e){r[t]=e}};function q(r){var t=D[r];return"function"==typeof t?t:D.default}function Q(r){var t,e,n;if(0===(t=r.length))return 0;for(e=1,n=0;n=0;o--)e[o]=n,n*=r[o];return e}(r)}Y(pr,"isPrimitive",tr),Y(pr,"isObject",cr),Y(gr,"assign",(function(r,t,e){return yr(t)?function(r,t){var e,n;for(e=1,n=0;n=0;n--)t[n]=e,e*=r[n];return t}(r,e)}));var mr="row-major";function vr(r,t){var e,n,o;return"object"!=typeof(o=r.strides)||null===o?0===(n=r.shape).length?[0]:(tr(e=r.order)||(e=mr),gr(n,e)):t?rr(o):o}function dr(r){return"number"==typeof r}var wr=Number,br=wr.prototype.toString,Er=nr();function _r(r){return"object"==typeof r&&(r instanceof wr||(Er?function(r){try{return br.call(r),!0}catch(r){return!1}}(r):"[object Number]"===sr(r)))}function Tr(r){return dr(r)||_r(r)}function xr(r){var t,e,n;return dr(n=r.offset)?n:0===(e=r.shape).length||"object"!=typeof(t=r.strides)||null===t?0:function(r,t){var e,n,o;for(n=r.length,e=0,o=0;oo&&(n=!1),!n&&!t)return 0;o=i}return n&&t?3:n?1:2}Y(Tr,"isPrimitive",dr),Y(Tr,"isObject",_r);var jr="row-major",Sr="column-major";function Fr(r){var t,e;return tr(e=r.order)?e:"object"!=typeof(t=r.strides)||null===t||1===(e=Ar(t))||3===e?jr:2===e?Sr:0===r.shape.length?jr:null}function Lr(r){var t,e,n,o;return t=function(r){return r.data}(r),n=function(r,t){var e=r.shape;return t?rr(e):e}(r,!0),o=function(r){return r.dtype}(r),e=$(t),{ref:r,dtype:o,data:t,length:Q(n),shape:n,strides:vr(r,!0),offset:xr(r),order:Fr(r),accessorProtocol:e,accessors:e?[K(o),z(o)]:[J(o),q(o)]}}var Or=16;function Ir(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Or}var kr=8;function Br(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===kr}var Rr,Pr="function"==typeof Float64Array,Mr="function"==typeof Float64Array?Float64Array:null,Cr="function"==typeof Float64Array?Float64Array:void 0;Rr=function(){var r,t,e;if("function"!=typeof Mr)return!1;try{t=new Mr([1,3.14,-3.14,NaN]),e=t,r=(Pr&&e instanceof Float64Array||"[object Float64Array]"===sr(e))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}()?Cr:function(){throw new Error("not implemented")};var Nr=Rr;function Ur(r,t){return new Nr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var Yr,Wr="function"==typeof Float32Array,Zr=Number.POSITIVE_INFINITY,$r="function"==typeof Float32Array?Float32Array:null,Gr="function"==typeof Float32Array?Float32Array:void 0;Yr=function(){var r,t,e;if("function"!=typeof $r)return!1;try{t=new $r([1,3.14,-3.14,5e40]),e=t,r=(Wr&&e instanceof Float32Array||"[object Float32Array]"===sr(e))&&1===t[0]&&3.140000104904175===t[1]&&-3.140000104904175===t[2]&&t[3]===Zr}catch(t){r=!1}return r}()?Gr:function(){throw new Error("not implemented")};var Kr=Yr;function Xr(r,t){return new Kr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var zr,Hr="function"==typeof Uint8Array,Jr="function"==typeof Uint8Array?Uint8Array:null,Dr="function"==typeof Uint8Array?Uint8Array:void 0;zr=function(){var r,t,e;if("function"!=typeof Jr)return!1;try{t=new Jr(t=[1,3.14,-3.14,256,257]),e=t,r=(Hr&&e instanceof Uint8Array||"[object Uint8Array]"===sr(e))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?Dr:function(){throw new Error("not implemented")};var qr=zr,Qr=Array.isArray?Array.isArray:function(r){return"[object Array]"===sr(r)};function rt(r){if("function"!=typeof r)throw new TypeError(I("invalid argument. Must provide a function. Value: `%s`.",r));return function(t){var e,n;if(!Qr(t))return!1;if(0===(e=t.length))return!1;for(n=0;nCt&&Ut(r)}function Wt(r){return dr(r)&&Yt(r)}function Zt(r){return _r(r)&&Yt(r.valueOf())}function $t(r){return Wt(r)||Zt(r)}function Gt(r){return Wt(r)&&r>=0}function Kt(r){return Zt(r)&&r.valueOf()>=0}function Xt(r){return Gt(r)||Kt(r)}Y($t,"isPrimitive",Wt),Y($t,"isObject",Zt),Y(Xt,"isPrimitive",Gt),Y(Xt,"isObject",Kt);var zt=4294967295;function Ht(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ut(r.length)&&r.length>=0&&r.length<=zt}var Jt=9007199254740991;function Dt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ut(r.length)&&r.length>=0&&r.length<=Jt}var qt="function"==typeof ArrayBuffer;function Qt(r){return qt&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===sr(r)}function re(r){return"object"==typeof r&&null!==r&&!Qr(r)}var te=rt(pr.isPrimitive),ee=rt(pr.isObject),ne=rt(pr);Y(ne,"primitives",te),Y(ne,"objects",ee);var oe=/./;function ie(r){return"boolean"==typeof r}var ae=Boolean,fe=Boolean.prototype.toString,ue=nr();function se(r){return"object"==typeof r&&(r instanceof ae||(ue?function(r){try{return fe.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===sr(r)))}function le(r){return ie(r)||se(r)}Y(le,"isPrimitive",ie),Y(le,"isObject",se);var he="object"==typeof self?self:null,ce="object"==typeof window?window:null,pe="object"==typeof globalThis?globalThis:null,ye=function(r){if(arguments.length){if(!ie(r))throw new TypeError(I("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(pe)return pe;if(he)return he;if(ce)return ce;throw new Error("unexpected error. Unable to resolve global object.")}(),ge=ye.document&&ye.document.childNodes,me=Int8Array,ve="function"==typeof oe||"object"==typeof me||"function"==typeof ge?function(r){return it(r).toLowerCase()}:function(r){var t;return null===r?"null":"object"==(t=typeof r)?it(r).toLowerCase():t};function de(r){return"function"===ve(r)}function we(r,t,e){U(r,t,{configurable:!1,enumerable:!0,writable:!1,value:e})}function be(r,t){if(!(this instanceof be))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!dr(r))throw new TypeError(I("invalid argument. Real component must be a number. Value: `%s`.",r));if(!dr(t))throw new TypeError(I("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return we(this,"re",r),we(this,"im",t),this}Y(be,"name","Complex128"),Y(be,"BYTES_PER_ELEMENT",8),Y(be.prototype,"BYTES_PER_ELEMENT",8),Y(be.prototype,"byteLength",16),Y(be.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(be.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Ee="function"==typeof Math.fround?Math.fround:null,_e=new Kr(1),Te="function"==typeof Ee?Ee:function(r){return _e[0]=r,_e[0]};function xe(r,t){if(!(this instanceof xe))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!dr(r))throw new TypeError(I("invalid argument. Real component must be a number. Value: `%s`.",r));if(!dr(t))throw new TypeError(I("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return we(this,"re",Te(r)),we(this,"im",Te(t)),this}function Ve(r){return r instanceof be||r instanceof xe||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Ae(r){return Ut(r/2)}function je(){return"function"==typeof fr&&"symbol"==typeof fr("foo")&&ar(fr,"iterator")&&"symbol"==typeof fr.iterator}Y(xe,"name","Complex64"),Y(xe,"BYTES_PER_ELEMENT",4),Y(xe.prototype,"BYTES_PER_ELEMENT",4),Y(xe.prototype,"byteLength",8),Y(xe.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(xe.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Se=je()?Symbol.iterator:null;function Fe(r,t,e){U(r,t,{configurable:!1,enumerable:!1,get:e})}function Le(r){return r.re}function Oe(r){return r.im}function Ie(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Ht(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Ve(n))return new TypeError(I("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));t.push(Le(n),Oe(n))}return t}var ke=2*Kr.BYTES_PER_ELEMENT,Be=je();function Re(r){return r instanceof Ce||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Pe(r){return r===Ce||"Complex128Array"===r.name}function Me(r,t){return new xe(r[t*=2],r[t+1])}function Ce(){var r,t,e,n;if(t=arguments.length,!(this instanceof Ce))return 0===t?new Ce:1===t?new Ce(arguments[0]):2===t?new Ce(arguments[0],arguments[1]):new Ce(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Kr(0);else if(1===t)if(Gt(arguments[0]))e=new Kr(2*arguments[0]);else if(Dt(arguments[0]))if((n=(e=arguments[0]).length)&&Qr(e)&&Ve(e[0])){if(e=function(r,t){var e,n,o,i;for(e=t.length,i=0,o=0;oe.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ke));e=new Kr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function Ne(r){return r.re}function Ue(r){return r.im}function Ye(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Ht(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Ve(n))return new TypeError(I("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));t.push(Ne(n),Ue(n))}return t}Y(Ce,"BYTES_PER_ELEMENT",ke),Y(Ce,"name","Complex64Array"),Y(Ce,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!de(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!de(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Re(r)){if(u=r.length,n){for(i=(o=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(re(r)&&Be&&de(r[Se])){if(!de((i=r[Se]()).next))throw new TypeError(I("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Ht(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Ve(i))return new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));n.push(Le(i),Oe(i))}return n}(i,n,t):Ie(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Me(this._buffer,r)})),Fe(Ce.prototype,"buffer",(function(){return this._buffer.buffer})),Fe(Ce.prototype,"byteLength",(function(){return this._buffer.byteLength})),Fe(Ce.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Ce.prototype,"BYTES_PER_ELEMENT",Ce.BYTES_PER_ELEMENT),Y(Ce.prototype,"copyWithin",(function(r,t){if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),Y(Ce.prototype,"entries",(function(){var r,t,e,n,o,i;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._buffer,e=this._length,i=-1,Y(t={},"next",(function(){return i+=1,o||i>=e?{done:!0}:{value:[i,Me(n,i)],done:!1}})),Y(t,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.entries()})),t})),Y(Ce.prototype,"every",(function(r,t){var e,n;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ut(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=Le(r),f=Oe(r),u=t;u=0;n--)if(o=Me(e,n),r.call(t,o,n,this))return o})),Y(Ce.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(o=Me(e,n),r.call(t,o,n,this))return n;return-1})),Y(Ce.prototype,"forEach",(function(r,t){var e,n,o;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return Me(this._buffer,r)})),Y(Ce.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Le(r),i=Oe(r),e=this._buffer,a=t;a1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Le(r),i=Oe(r),e=this._buffer,a=t;a=e?{done:!0}:{value:o,done:!1}})),Y(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.keys()})),t})),Y(Ce.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=Le(r),i=Oe(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Fe(Ce.prototype,"length",(function(){return this._length})),Y(Ce.prototype,"map",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(o=new this.constructor(this._length))._buffer,i=0;i1)n=t,i=0;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Me(e,0),i=1}for(;i1)n=t,i=o-1;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Me(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Me(e,i),i,this);return n})),Y(Ce.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ve(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Le(r),void(n[e+1]=Oe(r))}if(Re(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,s=n.byteOffset+e*ke,t.buffer===n.buffer&&t.byteOffsets){for(o=new Kr(t.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*ke,t.buffer===n.buffer&&t.byteOffsets){for(o=new Kr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*ke):(o=t-r,e=n.byteOffset+r*ke),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Ce.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!tr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e?{done:!0}:{value:Me(o,i),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(r,Se,(function(){return t.values()})),r})),Y(Ce.prototype,"with",(function(r,t){var e,n,o;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(o=this._length,r<0&&(r+=o),r<0||r>=o)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Ve(t))throw new TypeError(I("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=Le(t),e[2*r+1]=Oe(t),n}));var We=2*Nr.BYTES_PER_ELEMENT,Ze=je();function $e(r){return r instanceof Xe||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Ge(r){return r===Xe||"Complex64Array"===r.name}function Ke(r,t){return new be(r[t*=2],r[t+1])}function Xe(){var r,t,e,n;if(t=arguments.length,!(this instanceof Xe))return 0===t?new Xe:1===t?new Xe(arguments[0]):2===t?new Xe(arguments[0],arguments[1]):new Xe(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Nr(0);else if(1===t)if(Gt(arguments[0]))e=new Nr(2*arguments[0]);else if(Dt(arguments[0]))if((n=(e=arguments[0]).length)&&Qr(e)&&Ve(e[0])){if(e=function(r,t){var e,n,o,i;for(e=t.length,i=0,o=0;oe.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*We));e=new Nr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function ze(r){var t,e;for(t=[];!(e=r.next()).done;)t.push(ae(e.value));return t}Y(Xe,"BYTES_PER_ELEMENT",We),Y(Xe,"name","Complex128Array"),Y(Xe,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!de(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!de(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if($e(r)){if(u=r.length,n){for(i=(o=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(re(r)&&Ze&&de(r[Se])){if(!de((i=r[Se]()).next))throw new TypeError(I("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Ht(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Ve(i))return new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));n.push(Ne(i),Ue(i))}return n}(i,n,t):Ye(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Ke(this._buffer,r)})),Fe(Xe.prototype,"buffer",(function(){return this._buffer.buffer})),Fe(Xe.prototype,"byteLength",(function(){return this._buffer.byteLength})),Fe(Xe.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Xe.prototype,"BYTES_PER_ELEMENT",Xe.BYTES_PER_ELEMENT),Y(Xe.prototype,"copyWithin",(function(r,t){if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),Y(Xe.prototype,"entries",(function(){var r,t,e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,n=this._length,i=-1,a=-2,Y(e={},"next",(function(){var t;return i+=1,o||i>=n?{done:!0}:(t=new be(r[a+=2],r[a+1]),{value:[i,t],done:!1})})),Y(e,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(e,Se,(function(){return t.entries()})),e})),Y(Xe.prototype,"every",(function(r,t){var e,n;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ut(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=Ne(r),f=Ue(r),u=t;u=0;n--)if(o=Ke(e,n),r.call(t,o,n,this))return o})),Y(Xe.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(o=Ke(e,n),r.call(t,o,n,this))return n;return-1})),Y(Xe.prototype,"forEach",(function(r,t){var e,n,o;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return Ke(this._buffer,r)})),Fe(Xe.prototype,"length",(function(){return this._length})),Y(Xe.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Ne(r),i=Ue(r),e=this._buffer,a=t;a1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Ne(r),i=Ue(r),e=this._buffer,a=t;a=e?{done:!0}:{value:o,done:!1}})),Y(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.keys()})),t})),Y(Xe.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=Ne(r),i=Ue(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Y(Xe.prototype,"map",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(o=new this.constructor(this._length))._buffer,i=0;i1)n=t,i=0;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Ke(e,0),i=1}for(;i1)n=t,i=o-1;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Ke(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Ke(e,i),i,this);return n})),Y(Xe.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ve(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Ne(r),void(n[e+1]=Ue(r))}if($e(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,s=n.byteOffset+e*We,t.buffer===n.buffer&&t.byteOffsets){for(o=new Nr(t.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*We,t.buffer===n.buffer&&t.byteOffsets){for(o=new Nr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*We):(o=t-r,e=n.byteOffset+r*We),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Xe.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!pr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e?{done:!0}:{value:Ke(o,i),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(r,Se,(function(){return t.values()})),r})),Y(Xe.prototype,"with",(function(r,t){var e,n,o;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(o=this._length,r<0&&(r+=o),r<0||r>=o)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Ve(t))throw new TypeError(I("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=Ne(t),e[2*r+1]=Ue(t),n}));var He=qr.BYTES_PER_ELEMENT,Je=je();function De(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===He}function qe(r){return r===Qe}function Qe(){var r,t,e,n,o;if(t=arguments.length,!(this instanceof Qe))return 0===t?new Qe:1===t?new Qe(arguments[0]):2===t?new Qe(arguments[0],arguments[1]):new Qe(arguments[0],arguments[1],arguments[2]);if(0===t)e=new qr(0);else if(1===t)if(Gt(o=arguments[0]))e=new qr(o);else if(Dt(o))e=function(r,t){var e,n;for(e=t.length,n=0;ne.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*He));e=new qr(e,r,n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length),this}Y(Qe,"BYTES_PER_ELEMENT",He),Y(Qe,"name","BooleanArray"),Y(Qe,"from",(function(r){var t,e,n,o,i,a,f,u,s;if(!de(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!de(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),i=(o=new this(u))._buffer,s=0;s=e))return ae(t[r])})),Fe(Qe.prototype,"buffer",(function(){return this._buffer.buffer})),Fe(Qe.prototype,"byteLength",(function(){return this._buffer.byteLength})),Fe(Qe.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Qe.prototype,"BYTES_PER_ELEMENT",Qe.BYTES_PER_ELEMENT),Y(Qe.prototype,"copyWithin",(function(r,t){if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(r,t):this._buffer.copyWithin(r,t,arguments[2]),this})),Y(Qe.prototype,"entries",(function(){var r,t,e,n,o,i;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,n=this._buffer,e=this._length,i=-1,Y(t={},"next",(function(){return i+=1,o||i>=e?{done:!0}:{value:[i,ae(n[i])],done:!1}})),Y(t,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.entries()})),t})),Y(Qe.prototype,"every",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Wt(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(i=r?1:0,a=t;a=0;o--)if(n=ae(e[o]),r.call(t,n,o,this))return n})),Y(Qe.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,o=this._length-1;o>=0;o--)if(n=ae(e[o]),r.call(t,n,o,this))return o;return-1})),Y(Qe.prototype,"forEach",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return ae(this._buffer[r])})),Y(Qe.prototype,"includes",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ie(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n0){if(!tr(r))throw new TypeError(I("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(t=this._buffer,e=[],n=0;n=e?{done:!0}:{value:o,done:!1}})),Y(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.keys()})),t})),Y(Qe.prototype,"lastIndexOf",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ie(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(e=this._buffer,n=t;n>=0;n--)if(r===ae(e[n]))return n;return-1})),Fe(Qe.prototype,"length",(function(){return this._length})),Y(Qe.prototype,"map",(function(r,t){var e,n,o,i;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(o=this._buffer,e=(n=new this.constructor(this._length))._buffer,i=0;i1)o=t,i=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");o=ae(e[0]),i=1}for(;i1)o=t,i=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");o=ae(e[n-1]),i=n-2}for(;i>=0;i--)o=r(o,ae(e[i]),i,this);return o})),Y(Qe.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,e=this._length,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Dt(r)){if(e+(i=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=De(r)?r._buffer:r,f=n.byteOffset+e*He,t.buffer===n.buffer&&t.byteOffsetf){for(o=new qr(t.length),a=0;a=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));n[e]=r?1:0}})),Y(Qe.prototype,"slice",(function(r,t){var e,n,o,i,a,f;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,a=this._length,0===arguments.length)r=0,t=a;else{if(!Wt(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a)<0&&(r=0),1===arguments.length)t=a;else{if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a)<0&&(t=0):t>a&&(t=a)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*He):(o=t-r,e=n.byteOffset+r*He),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Qe.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!tr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e?{done:!0}:{value:ae(o[i]),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(r,Se,(function(){return t.values()})),r})),Y(Qe.prototype,"with",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Wt(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(n=this._length,r<0&&(r+=n),r<0||r>=n)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ie(t))throw new TypeError(I("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return(e=new this.constructor(this._buffer))._buffer[r]=t?1:0,e}));var rn=[Nr,Kr,dt,pt,St,Tt,Mt,qr,kt,Ce,Xe,Qe],tn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],en=tn.length;function nn(r){var t=function(r){var t;if(Qr(r))return"generic";if(et(r))return null;for(t=0;t0)for(l=0;l0)for(u=0;u0?0:(1-r)*t}(r,n))}function sn(r){var t,e;if(t=[],r<=0)return t;for(e=0;e=0&&a=0&&!(((s=r[i])<0?-s:s)<=e);)r[i+1]=s,t[a+1]=t[a],i-=1,a-=1;r[i+1]=f,t[a+1]=u,n+=1,o+=1}}(t=rr(t),e),{sh:r=function(r,t){var e,n;for(e=[],n=0;n0}function pn(r){return Zt(r)&&r.valueOf()>0}function yn(r){return cn(r)||pn(r)}function gn(r){return Object.keys(Object(r))}Y(un,"ndarray",fn),Y(sn,"assign",(function(r,t,e){var n=nn(r);return n.accessorProtocol?"complex128"===n.dtype?ln(r,Ur(r,0),t,e):"complex64"===n.dtype?ln(r,Xr(r,0),t,e):function(r,t,e){var n,o,i,a;for(n=r.data,o=r.accessors[1],a=e,i=0;a>=0&&a=0&&o=0&&t=0&&r.length<=st&&ar(r,"callee")&&!An(r,"callee")},Sn=Array.prototype.slice,Fn=An((function(){}),"prototype"),Ln=!An({toString:null},"toString");function On(r,t,e){var n,o;if(!Dt(r)&&!tr(r))throw new TypeError(I("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(0===(n=r.length))return-1;if(3===arguments.length){if(!Wt(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;o=e}else(o=n+e)<0&&(o=0)}else o=0;if(Tn(t)){for(;o0&&!ar(r,"0"))for(f=0;f1){if(!Gn(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ar(t,"duplicates")&&!ie(s=t.duplicates))throw new TypeError(I("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",s))}if(n=(e=Un(r)).length,a={},s)for(u=0;ut&&(t=n)}return(n=Hn.BLOCK_SIZE_IN_BYTES/t|0)>0?n:1}([r])}function Dn(r,t,e,n,o,i){var a,f,u,s,l;for(a=r.length,f=1,l=0;l=f&&(o=f-1);else if("wrap"===i)o<0?(o+=f)<0&&0!=(o%=f)&&(o+=f):o>=f&&(o-=f)>=f&&(o%=f);else if("normalize"===i&&o<0&&(o+=f),o<0||o>=f)throw new RangeError(I("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",f,o));if(u=e,yr(n)){for(l=0;l=0;l--)o-=s=o%r[l],o/=r[l],u+=s*t[l];return u}var qn="throw",Qn="throw",ro="throw",to=[function(r){return!!r.data[r.offset]},function(r){var t,e,n,o,i;for(n=r.shape[0],e=r.strides[0],o=r.offset,t=r.data,i=0;i0;)for(g0;)for(y0;)for(b0;)for(w0;)for(d0;)for(V0;)for(x0;)for(T0;)for(_0;)for(L0;)for(F0;)for(S0;)for(j0;)for(A0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(L0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(B0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(m0;)for(g0;)for(E0;)for(b0;)for(w0;)for(A0;)for(V0;)for(x0;)for(T0;)for(O0;)for(L0;)for(F0;)for(S0;)for(j0;)for(P0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(er0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(g0;)for(y0;)for(b0;)for(w0;)for(d0;)for(V0;)for(x0;)for(T0;)for(_0;)for(L0;)for(F0;)for(S0;)for(j0;)for(A0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(L0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(B0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport isNumber from './is_number.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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 defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - index offset\n* @returns {Array} linear indices\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*/\nfunction minmaxViewBufferIndex( shape, strides, offset ) {\n\tvar ndims;\n\tvar min;\n\tvar max;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tmin = offset;\n\tmax = offset;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( shape[ i ] === 0 ) {\n\t\t\treturn [ offset, offset ];\n\t\t}\n\t\ts = strides[ i ];\n\t\tif ( s > 0 ) {\n\t\t\tmax += s * ( shape[i]-1 );\n\t\t} else if ( s < 0 ) {\n\t\t\tmin += s * ( shape[i]-1 ); // decrements min\n\t\t}\n\t}\n\treturn [ min, max ];\n}\n\n\n// EXPORTS //\n\nexport default minmaxViewBufferIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Compute the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.\n*\n* @module @stdlib/ndarray-base-minmax-view-buffer-index\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view and assigns results to a provided output array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - index offset\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} linear indices\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 10, 109 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 0, 99 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 10, 109 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 0, 99 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*/\nfunction minmaxViewBufferIndex( shape, strides, offset, out ) {\n\tvar ndims;\n\tvar min;\n\tvar max;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tmin = offset;\n\tmax = offset;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( shape[ i ] === 0 ) {\n\t\t\tout[ 0 ] = offset;\n\t\t\tout[ 1 ] = offset;\n\t\t\treturn out;\n\t\t}\n\t\ts = strides[ i ];\n\t\tif ( s > 0 ) {\n\t\t\tmax += s * ( shape[i]-1 );\n\t\t} else if ( s < 0 ) {\n\t\t\tmin += s * ( shape[i]-1 ); // decrements min\n\t\t}\n\t}\n\tout[ 0 ] = min;\n\tout[ 1 ] = max;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default minmaxViewBufferIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Returns the number of elements in an array.\n*\n* @param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* var n = numel( [ 3, 3, 3 ] );\n* // returns 27\n*/\nfunction numel( shape ) {\n\tvar ndims;\n\tvar n;\n\tvar i;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0;\n\t}\n\tn = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tn *= shape[ i ];\n\t}\n\treturn n;\n}\n\n\n// EXPORTS //\n\nexport default numel;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default copy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 hasSymbols from '@stdlib/assert-has-symbol-support';\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns