diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 80f3fca..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,189 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# EditorConfig configuration file (see ).
-
-# Indicate that this file is a root-level configuration file:
-root = true
-
-# Set properties for all files:
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-# Set properties for JavaScript files:
-[*.{js,js.txt}]
-indent_style = tab
-
-# Set properties for JavaScript ES module files:
-[*.{mjs,mjs.txt}]
-indent_style = tab
-
-# Set properties for JavaScript CommonJS files:
-[*.{cjs,cjs.txt}]
-indent_style = tab
-
-# Set properties for JSON files:
-[*.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `cli_opts.json` files:
-[cli_opts.json]
-indent_style = tab
-
-# Set properties for TypeScript files:
-[*.ts]
-indent_style = tab
-
-# Set properties for Python files:
-[*.{py,py.txt}]
-indent_style = space
-indent_size = 4
-
-# Set properties for Julia files:
-[*.{jl,jl.txt}]
-indent_style = tab
-
-# Set properties for R files:
-[*.{R,R.txt}]
-indent_style = tab
-
-# Set properties for C files:
-[*.{c,c.txt}]
-indent_style = tab
-
-# Set properties for C header files:
-[*.{h,h.txt}]
-indent_style = tab
-
-# Set properties for C++ files:
-[*.{cpp,cpp.txt}]
-indent_style = tab
-
-# Set properties for C++ header files:
-[*.{hpp,hpp.txt}]
-indent_style = tab
-
-# Set properties for Fortran files:
-[*.{f,f.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for shell files:
-[*.{sh,sh.txt}]
-indent_style = tab
-
-# Set properties for AWK files:
-[*.{awk,awk.txt}]
-indent_style = tab
-
-# Set properties for HTML files:
-[*.{html,html.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for XML files:
-[*.{xml,xml.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for CSS files:
-[*.{css,css.txt}]
-indent_style = tab
-
-# Set properties for Makefiles:
-[Makefile]
-indent_style = tab
-
-[*.{mk,mk.txt}]
-indent_style = tab
-
-# Set properties for Markdown files:
-[*.{md,md.txt}]
-indent_style = space
-indent_size = 4
-trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim.
-
-# Set properties for `usage.txt` files:
-[usage.txt]
-indent_style = space
-indent_size = 2
-
-# Set properties for `repl.txt` files:
-[repl.txt]
-indent_style = space
-indent_size = 4
-
-# Set properties for `package.json` files:
-[package.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `datapackage.json` files:
-[datapackage.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `manifest.json` files:
-[manifest.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `tsconfig.json` files:
-[tsconfig.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for LaTeX files:
-[*.{tex,tex.txt}]
-indent_style = tab
-
-# Set properties for LaTeX Bibliography files:
-[*.{bib,bib.txt}]
-indent_style = tab
-
-# Set properties for YAML files:
-[*.{yml,yml.txt}]
-indent_style = space
-indent_size = 2
-
-# Ignore generated lock files for GitHub Agentic Workflows:
-[*.lock.yml]
-charset = unset
-end_of_line = unset
-indent_style = unset
-indent_size = unset
-trim_trailing_whitespace = unset
-insert_final_newline = unset
-
-# Set properties for GYP files:
-[binding.gyp]
-indent_style = space
-indent_size = 2
-
-[*.gypi]
-indent_style = space
-indent_size = 2
-
-# Set properties for citation files:
-[*.{cff,cff.txt}]
-indent_style = space
-indent_size = 2
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 5f30286..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1 +0,0 @@
-/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 24b327f..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,68 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Configuration file which assigns attributes to pathnames.
-#
-# [1]: https://git-scm.com/docs/gitattributes
-
-# Automatically normalize the line endings of any committed text files:
-* text=auto
-
-# Override line endings for certain files on checkout:
-*.crlf.csv text eol=crlf
-
-# Denote that certain files are binary and should not be modified:
-*.png binary
-*.jpg binary
-*.jpeg binary
-*.gif binary
-*.ico binary
-*.gz binary
-*.zip binary
-*.7z binary
-*.mp3 binary
-*.mp4 binary
-*.mov binary
-
-# Override what is considered "vendored" by GitHub's linguist:
-/lib/node_modules/** -linguist-vendored -linguist-generated
-
-# Configure directories which should *not* be included in GitHub language statistics:
-/deps/** linguist-vendored
-/dist/** linguist-generated
-/workshops/** linguist-vendored
-
-benchmark/** linguist-vendored
-docs/* linguist-documentation
-etc/** linguist-vendored
-examples/** linguist-documentation
-scripts/** linguist-vendored
-test/** linguist-vendored
-tools/** linguist-vendored
-
-# Configure files which should *not* be included in GitHub language statistics:
-Makefile linguist-vendored
-*.mk linguist-vendored
-*.jl linguist-vendored
-*.py linguist-vendored
-*.R linguist-vendored
-
-# Configure files which should be included in GitHub language statistics:
-docs/types/*.d.ts -linguist-documentation
-
-.github/workflows/*.lock.yml linguist-generated=true merge=ours
diff --git a/.github/.keepalive b/.github/.keepalive
deleted file mode 100644
index 890f35d..0000000
--- a/.github/.keepalive
+++ /dev/null
@@ -1 +0,0 @@
-2026-08-17T03:10:03.271Z
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index c2795a1..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/includes) 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 2fd8b41..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/includes) 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 503c136..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: '21 21 * * 0'
-
- # 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 includes = require( '@stdlib/ndarray-base-includes' );
+If no recognized module system is present, access bundle contents via the global scope:
+
+```html
+
```
#### includes( arrays )
@@ -148,10 +154,15 @@ Each provided ndarray should be an object with the following properties:
-```javascript
-var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
-var ndarray2array = require( '@stdlib/ndarray-base-to-array' );
-var includes = require( '@stdlib/ndarray-base-includes' );
+```html
+
+
+
+
+
+
+
+
+
```
@@ -185,111 +201,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_includes__[_as__]
-```
-
-For example,
-
-
-
-```c
-void stdlib_ndarray_includes_dd_x(...) {...}
-```
-
-is a function which accepts one double-precision floating-point input ndarray, a double-precision floating-point search element ndarray, and one boolean output ndarray.
-
-TODO: document casting convention
-
-
-
-
-
-
-
-
-
-### Usage
-
-```c
-#include "stdlib/ndarray/base/includes.h"
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-* * *
-
-
-
-### Examples
-
-```c
-// TODO
-```
-
-
-
-
-
-
-
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 66380bd..0000000
--- a/benchmark/benchmark.10d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 d085c7d..0000000
--- a/benchmark/benchmark.10d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 2e89e90..0000000
--- a/benchmark/benchmark.10d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 776cf7d..0000000
--- a/benchmark/benchmark.10d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 45a9f3d..0000000
--- a/benchmark/benchmark.11d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 5e9dc2c..0000000
--- a/benchmark/benchmark.11d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 37dcc2b..0000000
--- a/benchmark/benchmark.1d_columnmajor.js
+++ /dev/null
@@ -1,132 +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 includes = 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;
- var v;
-
- x = discreteUniform( len, 1, 100 );
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- v = {
- 'dtype': xtype,
- 'data': discreteUniform( 1, 101, 1000 ),
- 'shape': [],
- 'strides': [ 0 ],
- '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 = includes( [ x, v ] );
- 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 3427b49..0000000
--- a/benchmark/benchmark.1d_rowmajor.js
+++ /dev/null
@@ -1,132 +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 includes = 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;
- var v;
-
- x = discreteUniform( len, 1, 100 );
- x = {
- 'dtype': xtype,
- 'data': x,
- 'shape': shape,
- 'strides': shape2strides( shape, order ),
- 'offset': 0,
- 'order': order
- };
- v = {
- 'dtype': xtype,
- 'data': discreteUniform( 1, 101, 1000 ),
- 'shape': [],
- 'strides': [ 0 ],
- '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 = includes( [ x, v ] );
- 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 0af2356..0000000
--- a/benchmark/benchmark.2d_blocked_columnmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 68537fd..0000000
--- a/benchmark/benchmark.2d_blocked_rowmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 dad78d3..0000000
--- a/benchmark/benchmark.2d_columnmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 45f314b..0000000
--- a/benchmark/benchmark.2d_rowmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 175e5be..0000000
--- a/benchmark/benchmark.2d_rowmajor_accessors.js
+++ /dev/null
@@ -1,161 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 732699f..0000000
--- a/benchmark/benchmark.2d_rowmajor_accessors_complex.js
+++ /dev/null
@@ -1,168 +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 includes = 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;
- var v;
-
- 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 ]
- };
- v = {
- 're': 101,
- 'im': 102
- };
- 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 = includes( x, v );
- 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 1fc1c2c..0000000
--- a/benchmark/benchmark.3d_blocked_columnmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 fe92f4e..0000000
--- a/benchmark/benchmark.3d_blocked_rowmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 536a359..0000000
--- a/benchmark/benchmark.3d_columnmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 82e1abb..0000000
--- a/benchmark/benchmark.3d_rowmajor.js
+++ /dev/null
@@ -1,135 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 70b3190..0000000
--- a/benchmark/benchmark.4d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 41317aa..0000000
--- a/benchmark/benchmark.4d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 56d97a9..0000000
--- a/benchmark/benchmark.4d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 b9711d4..0000000
--- a/benchmark/benchmark.4d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 0232235..0000000
--- a/benchmark/benchmark.5d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 238cff6..0000000
--- a/benchmark/benchmark.5d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 939570c..0000000
--- a/benchmark/benchmark.5d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 fdbc708..0000000
--- a/benchmark/benchmark.5d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 e81f1fd..0000000
--- a/benchmark/benchmark.6d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 e1cdb2d..0000000
--- a/benchmark/benchmark.6d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 e39ae48..0000000
--- a/benchmark/benchmark.6d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 93c505f..0000000
--- a/benchmark/benchmark.6d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 495aff8..0000000
--- a/benchmark/benchmark.7d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 6ede5cf..0000000
--- a/benchmark/benchmark.7d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 a6d2407..0000000
--- a/benchmark/benchmark.7d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 ec49290..0000000
--- a/benchmark/benchmark.7d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 2abf53b..0000000
--- a/benchmark/benchmark.8d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 2abf53b..0000000
--- a/benchmark/benchmark.8d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 e77602a..0000000
--- a/benchmark/benchmark.8d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 364986e..0000000
--- a/benchmark/benchmark.8d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 1e99cf8..0000000
--- a/benchmark/benchmark.9d_blocked_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 da89e95..0000000
--- a/benchmark/benchmark.9d_blocked_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 2f820db..0000000
--- a/benchmark/benchmark.9d_columnmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 40e9bc4..0000000
--- a/benchmark/benchmark.9d_rowmajor.js
+++ /dev/null
@@ -1,134 +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 includes = 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 );
- 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 = includes( x, 101 );
- 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 3130530..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/includes"
-%% click B href "https://github.com/stdlib-js/ndarray-base-includes/tree/main"
-%% click C href "https://github.com/stdlib-js/ndarray-base-includes/tree/production"
-%% click D href "https://github.com/stdlib-js/ndarray-base-includes/tree/esm"
-%% click E href "https://github.com/stdlib-js/ndarray-base-includes/tree/deno"
-%% click F href "https://github.com/stdlib-js/ndarray-base-includes/tree/umd"
-```
-
-[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/includes
-[production-url]: https://github.com/stdlib-js/ndarray-base-includes/tree/production
-[deno-url]: https://github.com/stdlib-js/ndarray-base-includes/tree/deno
-[deno-readme]: https://github.com/stdlib-js/ndarray-base-includes/blob/deno/README.md
-[umd-url]: https://github.com/stdlib-js/ndarray-base-includes/tree/umd
-[umd-readme]: https://github.com/stdlib-js/ndarray-base-includes/blob/umd/README.md
-[esm-url]: https://github.com/stdlib-js/ndarray-base-includes/tree/esm
-[esm-readme]: https://github.com/stdlib-js/ndarray-base-includes/blob/esm/README.md
\ No newline at end of file
diff --git a/browser.js b/browser.js
new file mode 100644
index 0000000..57b882e
--- /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(wr,"name","Complex64"),Y(wr,"BYTES_PER_ELEMENT",4),Y(wr.prototype,"BYTES_PER_ELEMENT",4),Y(wr.prototype,"byteLength",8),Y(wr.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(wr.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r})),Y(Er,"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 _r="function";function Tr(r){return typeof r.get===_r&&typeof r.set===_r}var xr={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 Vr(r){var t=xr[r];return"function"==typeof t?t:xr.default}var Ar={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 jr(r){var t=Ar[r];return"function"==typeof t?t:Ar.default}var Sr={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 Fr(r){var t=Sr[r];return"function"==typeof t?t:Sr.default}var Lr={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 Or(r){var t=Lr[r];return"function"==typeof t?t:Lr.default}function Ir(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(Cr,"isPrimitive",Br),Y(Cr,"isObject",Mr),Y(Ur,"assign",(function(r,t,e){return Nr(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 Yr="row-major";function Wr(r,t){var e,n,o;return"object"!=typeof(o=r.strides)||null===o?0===(n=r.shape).length?[0]:(Br(e=r.order)||(e=Yr),Ur(n,e)):t?kr(o):o}function Zr(r){var t,e,n;return er(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}var Kr="row-major",Xr="column-major";function zr(r){var t,e;return Br(e=r.order)?e:"object"!=typeof(t=r.strides)||null===t||1===(e=Gr(t))||3===e?Kr:2===e?Xr:0===r.shape.length?Kr:null}function Hr(r){var t,e,n,o;return t=function(r){return r.data}(r),n=function(r,t){var e=r.shape;return t?kr(e):e}(r,!0),o=function(r){return r.dtype}(r),e=Tr(t),{ref:r,dtype:o,data:t,length:Ir(n),shape:n,strides:Wr(r,!0),offset:Zr(r),order:zr(r),accessorProtocol:e,accessors:e?[Vr(o),jr(o)]:[Fr(o),Or(o)]}}var Jr=16;function Dr(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Jr}var qr=8;function Qr(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===qr}var rt,tt="function"==typeof Float64Array,et="function"==typeof Float64Array?Float64Array:null,nt="function"==typeof Float64Array?Float64Array:void 0;rt=function(){var r,t,e;if("function"!=typeof et)return!1;try{t=new et([1,3.14,-3.14,NaN]),e=t,r=(tt&&e instanceof Float64Array||"[object Float64Array]"===J(e))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}()?nt:function(){throw new Error("not implemented")};var ot=rt;function it(r,t){return new ot(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}function at(r,t){return new mr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var ft,ut="function"==typeof Uint8Array,st="function"==typeof Uint8Array?Uint8Array:null,lt="function"==typeof Uint8Array?Uint8Array:void 0;ft=function(){var r,t,e;if("function"!=typeof st)return!1;try{t=new st(t=[1,3.14,-3.14,256,257]),e=t,r=(ut&&e instanceof Uint8Array||"[object Uint8Array]"===J(e))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?lt:function(){throw new Error("not implemented")};var ht=ft;function ct(r){return r.re}function pt(r){return r.im}var yt=Array.isArray?Array.isArray:function(r){return"[object Array]"===J(r)};function gt(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(!yt(t))return!1;if(0===(e=t.length))return!1;for(n=0;nQt&&te(r)}function ne(r){return er(r)&&ee(r)}function oe(r){return ar(r)&&ee(r.valueOf())}function ie(r){return ne(r)||oe(r)}function ae(r){return ne(r)&&r>=0}function fe(r){return oe(r)&&r.valueOf()>=0}function ue(r){return ae(r)||fe(r)}Y(ie,"isPrimitive",ne),Y(ie,"isObject",oe),Y(ue,"isPrimitive",ae),Y(ue,"isObject",fe);var se=4294967295;function le(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&te(r.length)&&r.length>=0&&r.length<=se}var he=9007199254740991;function ce(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&te(r.length)&&r.length>=0&&r.length<=he}var pe="function"==typeof ArrayBuffer;function ye(r){return pe&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===J(r)}function ge(r){return"object"==typeof r&&null!==r&&!yt(r)}var me=gt(Cr.isPrimitive),ve=gt(Cr.isObject),de=gt(Cr);Y(de,"primitives",me),Y(de,"objects",ve);var we=/./,be="object"==typeof self?self:null,Ee="object"==typeof window?window:null,_e="object"==typeof globalThis?globalThis:null,Te=function(r){if(arguments.length){if(!W(r))throw new TypeError(I("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(_e)return _e;if(be)return be;if(Ee)return Ee;throw new Error("unexpected error. Unable to resolve global object.")}(),xe=Te.document&&Te.document.childNodes,Ve=Int8Array,Ae="function"==typeof we||"object"==typeof Ve||"function"==typeof xe?function(r){return bt(r).toLowerCase()}:function(r){var t;return null===r?"null":"object"==(t=typeof r)?bt(r).toLowerCase():t};function je(r){return"function"===Ae(r)}function Se(r){return te(r/2)}function Fe(){return"function"==typeof z&&"symbol"==typeof z("foo")&&X(z,"iterator")&&"symbol"==typeof z.iterator}var Le=Fe()?Symbol.iterator:null;function Oe(r,t,e){U(r,t,{configurable:!1,enumerable:!1,get:e})}function Ie(r){return r.re}function ke(r){return r.im}function Be(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(le(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!br(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(Ie(n),ke(n))}return t}var Re=2*mr.BYTES_PER_ELEMENT,Pe=Fe();function Me(r){return r instanceof Ue||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Ce(r){return r===Ue||"Complex128Array"===r.name}function Ne(r,t){return new wr(r[t*=2],r[t+1])}function Ue(){var r,t,e,n;if(t=arguments.length,!(this instanceof Ue))return 0===t?new Ue:1===t?new Ue(arguments[0]):2===t?new Ue(arguments[0],arguments[1]):new Ue(arguments[0],arguments[1],arguments[2]);if(0===t)e=new mr(0);else if(1===t)if(ae(arguments[0]))e=new mr(2*arguments[0]);else if(ce(arguments[0]))if((n=(e=arguments[0]).length)&&yt(e)&&br(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*Re));e=new mr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function Ye(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(le(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!br(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(ct(n),pt(n))}return t}Y(Ue,"BYTES_PER_ELEMENT",Re),Y(Ue,"name","Complex64Array"),Y(Ue,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!je(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ce(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!je(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Me(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(ce(r)){if(n){for(u=r.length,f=r.get&&r.set?Vr("default"):Fr("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(ge(r)&&Pe&&je(r[Le])){if(!je((i=r[Le]()).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,le(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!br(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(Ie(i),ke(i))}return n}(i,n,t):Be(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Ne(this._buffer,r)})),Oe(Ue.prototype,"buffer",(function(){return this._buffer.buffer})),Oe(Ue.prototype,"byteLength",(function(){return this._buffer.byteLength})),Oe(Ue.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Ue.prototype,"BYTES_PER_ELEMENT",Ue.BYTES_PER_ELEMENT),Y(Ue.prototype,"copyWithin",(function(r,t){if(!Me(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(Ue.prototype,"entries",(function(){var r,t,e,n,o,i;if(!Me(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,Ne(n,i)],done:!1}})),Y(t,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Le&&Y(t,Le,(function(){return r.entries()})),t})),Y(Ue.prototype,"every",(function(r,t){var e,n;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!je(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!te(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(!te(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=Ie(r),f=ke(r),u=t;u=0;n--)if(o=Ne(e,n),r.call(t,o,n,this))return o})),Y(Ue.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!je(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=Ne(e,n),r.call(t,o,n,this))return n;return-1})),Y(Ue.prototype,"forEach",(function(r,t){var e,n,o;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!je(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 Ne(this._buffer,r)})),Y(Ue.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!br(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!te(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=Ie(r),i=ke(r),e=this._buffer,a=t;a1){if(!te(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=Ie(r),i=ke(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}})),Le&&Y(t,Le,(function(){return r.keys()})),t})),Y(Ue.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!br(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!te(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=Ie(r),i=ke(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Oe(Ue.prototype,"length",(function(){return this._length})),Y(Ue.prototype,"map",(function(r,t){var e,n,o,i,a;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!je(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=Ne(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=Ne(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Ne(e,i),i,this);return n})),Y(Ue.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=re(e/2),o=0;o1){if(!ae(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(br(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Ie(r),void(n[e+1]=ke(r))}if(Me(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*Re,t.buffer===n.buffer&&t.byteOffsets){for(o=new mr(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*Re,t.buffer===n.buffer&&t.byteOffsets){for(o=new mr(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*Re):(o=t-r,e=n.byteOffset+r*Re),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Ue.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Br(r)&&!me(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(!ge(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:Ne(o,i),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Le&&Y(r,Le,(function(){return t.values()})),r})),Y(Ue.prototype,"with",(function(r,t){var e,n,o;if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(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(!br(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]=Ie(t),e[2*r+1]=ke(t),n}));var We=2*ot.BYTES_PER_ELEMENT,Ze=Fe();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 sr(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 ot(0);else if(1===t)if(ae(arguments[0]))e=new ot(2*arguments[0]);else if(ce(arguments[0]))if((n=(e=arguments[0]).length)&&yt(e)&&br(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 ot(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(D(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(!je(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(!je(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(ce(r)){if(n){for(u=r.length,f=r.get&&r.set?Vr("default"):Fr("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(ge(r)&&Ze&&je(r[Le])){if(!je((i=r[Le]()).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,le(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!br(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(ct(i),pt(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)})),Oe(Xe.prototype,"buffer",(function(){return this._buffer.buffer})),Oe(Xe.prototype,"byteLength",(function(){return this._buffer.byteLength})),Oe(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 sr(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}})),Le&&Y(e,Le,(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(!je(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!te(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(!te(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=ct(r),f=pt(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(!je(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(!je(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)})),Oe(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(!br(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!te(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=ct(r),i=pt(r),e=this._buffer,a=t;a1){if(!te(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=ct(r),i=pt(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}})),Le&&Y(t,Le,(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(!br(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!te(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=ct(r),i=pt(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(!je(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=re(e/2),o=0;o1){if(!ae(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(br(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=ct(r),void(n[e+1]=pt(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 ot(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 ot(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(!Cr(r)&&!me(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(!ge(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}})),Le&&Y(r,Le,(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(!te(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(!br(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]=ct(t),e[2*r+1]=pt(t),n}));var He=ht.BYTES_PER_ELEMENT,Je=Fe();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 ht(0);else if(1===t)if(ae(o=arguments[0]))e=new ht(o);else if(ce(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 ht(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(!je(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(!je(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(ce(r)){if(n){for(u=r.length,f=r.get&&r.set?Vr("default"):Fr("default"),i=(o=new this(u))._buffer,s=0;s=e))return D(t[r])})),Oe(Qe.prototype,"buffer",(function(){return this._buffer.buffer})),Oe(Qe.prototype,"byteLength",(function(){return this._buffer.byteLength})),Oe(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,D(n[i])],done:!1}})),Y(t,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Le&&Y(t,Le,(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(!je(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!ne(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(!ne(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=D(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(!je(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=D(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(!je(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 D(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(!W(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!ne(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(!ne(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(!Br(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}})),Le&&Y(t,Le,(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(!W(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!ne(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===D(e[n]))return n;return-1})),Oe(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(!je(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=D(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=D(e[n-1]),i=n-2}for(;i>=0;i--)o=r(o,D(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=re(e/2),o=0;o1){if(!ae(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(ce(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 ht(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(!ne(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(!ne(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(!Br(r)&&!me(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(!ge(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:D(o[i]),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Le&&Y(r,Le,(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(!ne(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(!W(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=[ot,mr,kt,St,Zt,Ct,qt,ht,zt,Ue,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(yt(r))return"generic";if(vt(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=kr(t),e),{sh:r=function(r,t){var e,n;for(e=[],n=0;n0}function pn(r){return oe(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,it(r,0),t,e):"complex64"===n.dtype?ln(r,at(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<=xt&&X(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(!ce(r)&&!Br(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(!ne(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&&!X(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(X(t,"duplicates")&&!W(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,Nr(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,t){return r.data[r.offset]===t},function(r,t){var e,n,o,i,a;for(o=r.shape[0],n=r.strides[0],i=r.offset,e=r.data,a=0;a0;)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(v0;)for(m0;)for(_0;)for(E0;)for(b0;)for(j0;)for(A0;)for(V0;)for(x0;)for(I0;)for(O0;)for(L0;)for(F0;)for(S0;)for(M0;)for(P0;)for(R0;)for(B0;)for(k0;)for(I0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(nr0;)for(er0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)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(X 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/**\n* Tests if a value is a boolean primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean primitive\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns false\n*/\nfunction isBoolean( value ) {\n\treturn ( typeof value === 'boolean' );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\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 \n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nexport default hasToStringTagSupport;\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* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns \n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasSymbolSupport;\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\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nexport default toStr;\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// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nexport default hasOwnProp;\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\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Sym;\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 Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nexport default toStrTag;\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* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils-native-class\n*\n* @example\n* import nativeClass from '@stdlib/utils-native-class';\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\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// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport toStringTag from './tostringtag.js';\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\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 toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\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* Returns a boolean.\n*\n* @name Boolean\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {(boolean|Boolean)} boolean\n*\n* @example\n* var b = Boolean( null );\n* // returns false\n*\n* b = Boolean( [] );\n* // returns true\n*\n* b = Boolean( {} );\n* // returns true\n*\n* @example\n* var b = new Boolean( false );\n* // returns \n*/\nvar Bool = Boolean; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Bool;\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// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Boolean.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\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 hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Boolean from '@stdlib/boolean-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean object\n*\n* @example\n* var bool = isBoolean( true );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Boolean ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Boolean]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\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 toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\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 test;\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 isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a boolean\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\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 number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\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* Test if a value is a boolean.\n*\n* @module @stdlib/assert-is-boolean\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import isBoolean from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( true ) );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import { isObject as isBoolean } from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( true );\n* // returns false\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\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// EXPORTS //\n\nexport default Number; // eslint-disable-line stdlib/require-globals\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 Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\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 hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Number from '@stdlib/number-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\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 toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\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 test;\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 isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\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 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* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadOnly;\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 { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport setEnumerableReadOnly from '@stdlib/utils-define-read-only-property';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport format from '@stdlib/string-format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 128-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex128( real, imag ) {\n\tif ( !( this instanceof Complex128 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', real );\n\tsetEnumerableReadOnly( this, 'im', imag );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128\n* @readonly\n* @type {string}\n* @default 'Complex128'\n*\n* @example\n* var name = Complex128.name;\n* // returns 'Complex128'\n*/\nsetReadOnly( Complex128, 'name', 'Complex128' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex128.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 16\n*/\nsetReadOnly( Complex128.prototype, 'byteLength', 16 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex128.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance.\n*\n* @name toJSON\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex128.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex128;\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* Test if a value is a number.\n*\n* @module @stdlib/assert-is-number\n*\n* @example\n* import isNumber from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\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/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\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* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex128';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\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\nvar fround = ( typeof Math.fround === 'function' ) ? Math.fround : null; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default fround;\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* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float32\n*\n* @example\n* import ctor from '@stdlib/array-float32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat32ArraySupport from '@stdlib/assert-has-float32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat32Array = ( typeof Float32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float32Array\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var bool = isFloat32Array( new Float32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat32Array( [] );\n* // returns false\n*/\nfunction isFloat32Array( value ) {\n\treturn (\n\t\t( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat32Array;\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* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants-float64-pinf\n* @type {number}\n*\n* @example\n* import FLOAT64_PINF from '@stdlib/constants-float64-pinf';\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default FLOAT64_PINF;\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\nvar main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals\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\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\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 isFloat32Array from '@stdlib/assert-is-float32array';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport GlobalFloat32Array from './float32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float32Array` support\n*\n* @example\n* var bool = hasFloat32ArraySupport();\n* // returns \n*/\nfunction hasFloat32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );\n\t\tbool = (\n\t\t\tisFloat32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.140000104904175 &&\n\t\t\tarr[ 2 ] === -3.140000104904175 &&\n\t\t\tarr[ 3 ] === PINF\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat32ArraySupport;\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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\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 Float32Array from '@stdlib/array-float32';\n\n\n// VARIABLES //\n\nvar FLOAT32_VIEW = new Float32Array( 1 );\n\n\n// MAIN //\n\n/**\n* Converts a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @param {number} x - double-precision floating-point number\n* @returns {number} nearest single-precision floating-point number\n*\n* @example\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\nfunction float64ToFloat32( x ) {\n\tFLOAT32_VIEW[ 0 ] = x;\n\treturn FLOAT32_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\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* Convert a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @module @stdlib/number-float64-base-to-float32\n*\n* @example\n* import float64ToFloat32 from '@stdlib/number-float64-base-to-float32';\n*\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\n\n// MODULES //\n\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar float64ToFloat32;\nif ( typeof builtin === 'function' ) {\n\tfloat64ToFloat32 = builtin;\n} else {\n\tfloat64ToFloat32 = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\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 { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport setEnumerableReadOnly from '@stdlib/utils-define-read-only-property';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport float64ToFloat32 from '@stdlib/number-float64-base-to-float32';\nimport format from '@stdlib/string-format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 64-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n* // returns